An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          


Degree














## 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.