{"id":13778086,"url":"https://github.com/joogps/IrregularGradient","last_synced_at":"2025-05-11T11:34:52.702Z","repository":{"id":41180227,"uuid":"318047043","full_name":"joogps/IrregularGradient","owner":"joogps","description":"Create animated irregular gradients in SwiftUI.","archived":false,"fork":false,"pushed_at":"2024-02-22T18:22:26.000Z","size":46168,"stargazers_count":228,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T02:54:00.068Z","etag":null,"topics":["animated","gradient","ios","irregular","macos","mesh","movement","swift","swiftui","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joogps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-12-03T02:06:53.000Z","updated_at":"2025-04-08T05:20:15.000Z","dependencies_parsed_at":"2024-02-22T19:45:27.497Z","dependency_job_id":null,"html_url":"https://github.com/joogps/IrregularGradient","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":0.02941176470588236,"last_synced_commit":"104d51be2eeb2b3c3db67c0aced7bda0f2239075"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joogps%2FIrregularGradient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joogps%2FIrregularGradient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joogps%2FIrregularGradient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joogps%2FIrregularGradient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joogps","download_url":"https://codeload.github.com/joogps/IrregularGradient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253559874,"owners_count":21927695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animated","gradient","ios","irregular","macos","mesh","movement","swift","swiftui","tvos","watchos"],"created_at":"2024-08-03T18:00:51.076Z","updated_at":"2025-05-11T11:34:52.411Z","avatar_url":"https://github.com/joogps.png","language":"Swift","readme":"\u003ch1\u003e IrregularGradient\n  \u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/joogps/IrregularGradient/blob/assets/Icon-dark-small.png?raw=true\"\u003e\n    \u003cimg align=\"right\" alt=\"Project logo\" src=\"../assets/Icon-light-small.png\" width=74px\u003e\n  \u003c/picture\u003e\n\u003c/h1\u003e\n\n\u003cp\u003e\n    \u003cimg src=\"https://img.shields.io/badge/iOS-13.0+-blue.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/macOS-10.15+-blue.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/tvOS-13.0+-blue.svg\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/watchOS-6.0+-blue.svg\" /\u003e\n    \u003cbr\u003e\n    \u003cimg src=\"https://img.shields.io/badge/-SwiftUI-red.svg\" /\u003e\n    \u003ca href=\"https://twitter.com/joogps\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contact-@joogps-lightgrey.svg?style=social\u0026logo=twitter\" alt=\"Twitter: @joogps\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA SwiftUI library for rendering beautiful, animated  and _irregular_ gradient views.\n\n\u003e [!NOTE]  \n\u003e This project implements this effect using pure SwiftUI, which can be computationally expensive. If you want something more efficient, please consider switching to [FluidGradient](https://github.com/Cindori/FluidGradient).\n\n## Installation\n\nThis repository is a Swift package, so just include it in your Xcode project and target under **File \u003e Add package dependencies**. Then, `import IrregularGradient` to the Swift files where you'll be using it.\n\n## Usage\n\nYou can add an irregular gradient to your app with the following modifier:\n\n```swift\nRoundedRectangle(cornerRadius: 24.0, style: .continuous)\n    .irregularGradient(colors: [.orange, .pink, .yellow, .orange, .pink, .yellow], backgroundColor: .orange)\n```\n\nThe other parameters go as follow:\n\n```swift\nirregularGradient(colors: [Color], background: () -\u003e View, shouldAnimate: Binding\u003cBool\u003e = .constant(true), speed: Double = 10)\n```\n\n-  `colors` specifies the colors of each blob. Order and amount matters, so the colors will be stacked in the order of the array on the Z axis. Having two entries of the same color will create two completely distinct blobs of that color.\n-  `background` defines the background of your gradient. It's a closure that returns a view. Not specifying this value it will make the background clear. \n- `shouldAnimate` is a boolean that specifies whether or not the gradient blobs should move. It can be enabled and disabled dinamically, and movement will always slow down to a stop. The default value is `true`.\n- `speed` accepts a Double and defines the speed of the movement — a 0.5 speed means the blobs will update every 2 seconds. The default value is 1.\n\nYou can also use the `IrregularGradient` standalone view, which exists in its own container.\n\n## How it's done\nThe current implementation of this package is done through the creation of blobs (SwiftUI's [Ellipse](https://developer.apple.com/documentation/swiftui/ellipse) shape) of the specified colors that move and scale randomly in the container, and are then blurred to achieve the desired effect.\n\n## Questions\n\nIf you have any questions or suggestions, you can create an issue or pull request on this GitHub repository or even contact me via [Twitter](https://twitter.com/joogps) or [email](mailto:joogps@gmail.com).\n","funding_links":[],"categories":["Gradient"],"sub_categories":["Content"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoogps%2FIrregularGradient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoogps%2FIrregularGradient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoogps%2FIrregularGradient/lists"}