{"id":19710480,"url":"https://github.com/rootstrap/swiftgradients","last_synced_at":"2025-04-29T17:31:16.915Z","repository":{"id":56597541,"uuid":"278187153","full_name":"rootstrap/SwiftGradients","owner":"rootstrap","description":"Useful extensions for UIViews and CALayer classes to add beautiful color gradients.","archived":false,"fork":false,"pushed_at":"2020-10-29T15:21:41.000Z","size":548,"stargazers_count":18,"open_issues_count":5,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-15T16:21:37.870Z","etag":null,"topics":["calayer","carthage","cocoapods","colors","gradients","library","spm","swift","swift-package-manager","swift5","uiview"],"latest_commit_sha":null,"homepage":"https://rootstrap.com/","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/rootstrap.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}},"created_at":"2020-07-08T20:22:51.000Z","updated_at":"2024-10-08T03:54:31.000Z","dependencies_parsed_at":"2022-08-15T21:40:28.878Z","dependency_job_id":null,"html_url":"https://github.com/rootstrap/SwiftGradients","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2FSwiftGradients","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2FSwiftGradients/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2FSwiftGradients/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2FSwiftGradients/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/SwiftGradients/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251549193,"owners_count":21607367,"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":["calayer","carthage","cocoapods","colors","gradients","library","spm","swift","swift-package-manager","swift5","uiview"],"created_at":"2024-11-11T22:07:30.614Z","updated_at":"2025-04-29T17:31:16.000Z","avatar_url":"https://github.com/rootstrap.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SwiftGradients\n\n[![CI Status](https://img.shields.io/travis/rootstrap/SwiftGradients.svg?style=flat)](https://travis-ci.org/rootstrap/SwiftGradients)\n[![Version](https://img.shields.io/cocoapods/v/SwiftGradients.svg?style=flat)](https://cocoapods.org/pods/SwiftGradients)\n[![License](https://img.shields.io/cocoapods/l/SwiftGradients.svg?style=flat)](https://cocoapods.org/pods/SwiftGradients)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftGradients.svg?style=flat)](https://cocoapods.org/pods/SwiftGradients)\n[![Carthage](https://img.shields.io/badge/Carthage-compatible-success)](#installation)\n[![SPM](https://img.shields.io/badge/SPM-compatible-success)](#installation)\n[![Swift Version](https://img.shields.io/badge/Swift%20Version-5.2-orange)](https://cocoapods.org/pods/SwiftGradients)\n\n## What is it?\n\n**SwiftGradients** gives you useful extensions for `UIViews` and `CALayer` classes to add beautiful color gradients.\n\n## Installation\n\n#### 1. Cocoapods\n\n```ruby\n\npod 'SwiftGradients', '~\u003e 1.0.0'\n```\n\n#### 2. Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\nAdd the following line to your `Cartfile` and follow the [installation instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).\n\n```\ngithub \"rootstrap/SwiftGradients\" ~\u003e 1.0.0\n```\n\n#### 3. Swift Package Manager\n\n- In XCode 11, go to File -\u003e Swift Packages -\u003e Add Package Dependency.\n- Enter the repo URL (https://github.com/rootstrap/SwiftGradients) and click Next.\n- Select the version rule desired (you can specify a version number, branch or commit) and click Next.\n- Finally, select the target where you want to use the framework.\n\nThat should be it. **SwiftGradients** should appear in the navigation panel as a dependency and the framework will be linked automatically to your target.\n\n\n**Note:** It is always recommended to lock your external libraries to a specific version.\n\n## Usage\n\n#### 1. Adding gradients to your subviews\n\n```swift\nlet gradientLayer = view.addGradient(\n  colors: [.blue, .green],\n  direction: .topToBottom\n)\n```\n\n#### 2. Customize options for your gradient\n\nYou can set a custom angle(measured in degrees and anti-clockwise), rather that one of the four predefined directions.\nAlso, you can provide the color stop locations for better accuracy.\n\n```swift\nlet gradientLayer = view.addGradient(\n  colors: [.blue, .green, .black],\n  angle: 45\n  locations: [0, 50, 75]\n)\n```\n\n#### Voilà\n\n\u003cimg src=\"https://github.com/rootstrap/SwiftGradients/blob/master/gradient-preview.png\" height=\"500\"/\u003e\n\u003cbr/\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\n## License\n\n**SwiftGradients** is available under the MIT license. See the LICENSE file for more info.\n\n[\u003cimg src=\"https://s3-us-west-1.amazonaws.com/rootstrap.com/img/rs.png\" width=\"100\"/\u003e](http://www.rootstrap.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fswiftgradients","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Fswiftgradients","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fswiftgradients/lists"}