https://github.com/simplisticated/degree
Gradient made in Swift
https://github.com/simplisticated/degree
color gradient swift uiview xcode
Last synced: 5 months ago
JSON representation
Gradient made in Swift
- Host: GitHub
- URL: https://github.com/simplisticated/degree
- Owner: simplisticated
- License: mit
- Created: 2018-06-21T14:56:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T18:50:27.000Z (over 7 years ago)
- Last Synced: 2025-06-11T08:44:58.976Z (9 months ago)
- Topics: color, gradient, swift, uiview, xcode
- Language: Swift
- Homepage:
- Size: 422 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## At a Glance
`Degree` is a tool for making gradient in Swift.
## How To Get Started
- Copy content of `Source` folder to your project.
or
- Use `Degree` cocoapod
## Requirements
* iOS 9 and later
* Xcode 9 and later
* Swift 4
## Usage
Example of usage:
```swift
let gradientView = GradientView()
gradientView.gradient = Gradient.make
.from(
x: .left,
y: .top
)
.to(
x: .right,
y: .bottom
)
.step(withColor: .white, andLocation: 0.0)
.step(withColor: .orange, andLocation: 0.5)
.step(withColor: .purple, andLocation: 1.0)
.get
```
Each step is defined by its color and location, which is a `Float` value from `0.0` to `1.0`.
## License
`Degree` is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.