https://github.com/yageek/grade-swift
:fireworks: Generate gradient from the 2 main dominant colours in an image. Port of grade.js
https://github.com/yageek/grade-swift
coregraphics gradient ios
Last synced: over 1 year ago
JSON representation
:fireworks: Generate gradient from the 2 main dominant colours in an image. Port of grade.js
- Host: GitHub
- URL: https://github.com/yageek/grade-swift
- Owner: yageek
- License: mit
- Created: 2018-09-04T13:45:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-08T08:20:41.000Z (over 7 years ago)
- Last Synced: 2025-01-26T02:45:12.997Z (over 1 year ago)
- Topics: coregraphics, gradient, ios
- Language: Swift
- Homepage:
- Size: 903 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Grade Swift
Generate gradient from the 2 main dominant colours in an image. This a port of [grade](https://github.com/benhowdle89/grade) in Swift for iOS.

## Setup
As cocoapods/carthage support is not available yet, simply include the `Source/Grade.swift` file in your project.
## Usage
```swift
// iOS
let image = UIImage(named: "myimage")!
let (start, end) = GradeColors(forImage: image)
```
An sample project is available inside the `Sample-iOS` directory.