https://github.com/gkye/ComplimentaryGradientView
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js
https://github.com/gkye/ComplimentaryGradientView
cocoapods color gradient ios swift
Last synced: 3 months ago
JSON representation
Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js
- Host: GitHub
- URL: https://github.com/gkye/ComplimentaryGradientView
- Owner: gkye
- License: mit
- Created: 2016-08-23T03:55:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-09T02:53:42.000Z (about 6 years ago)
- Last Synced: 2025-07-27T21:56:07.339Z (3 months ago)
- Topics: cocoapods, color, gradient, ios, swift
- Language: Swift
- Homepage:
- Size: 28.8 MB
- Stars: 733
- Watchers: 14
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - ComplimentaryGradientView - Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js. (Media / Image)
- awesome-cocoa - ComplimentaryGradientView
- awesome-gradient - ComplimentaryGradientView - Create complementary gradients generated from dominant and prominent colors in supplied image. (Swift)
- awesome-ios-star - ComplimentaryGradientView - Create complementary gradients generated from dominant and prominent colors in supplied image. Inspired by Grade.js. (Media / Image)
README
[](https://codebeat.co/projects/github-com-gkye-complimentarygradientview)
# ComplimentaryGradientView
Create complementary gradients generated from dominant and prominent colors in supplied image.
Inspired by Grade.js :heart:
`.all`
gradientStartPoint: `left` | `colors(start: .primary, end: .background)`
gradientStartPoint:`top`
:-------------------------:|:-------------------------:
 | 
`colors(start: .detail, end: .background)`
gradientStartPoint:`top` |
`colors(start: .secondary, end: .background)`
gradientStartPoint:`bottom`
:-------------------------:|:-------------------------:
 | 
## Demo
#### Sorry for the poor quality gif

## Usage
### Code
```swift
let gradientView = ComplimentaryGradientView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
//Colors for gradient are derived from the provided image
gradientView.image = UIImage(named: "myImg")
gradientView.gradientTpye = .colors(start: .primary, end: .secondary)
// Default = `.left`
gradientView.gradientStartPoint = .left
// Default = `.high`
gradientView.quality = .high
```
### Storyboard

### Migration [Guide](https://github.com/gkye/ComplimentaryGradientView/wiki/3.0-Migration-Guide).
Version 3.0 introduces `GradientVariant` and reduces `GradientType` to two simple options:
``` swift
// Create a gradient using all colors found in image
case all
// Create gradient using variants. ie. .colors(start: .primary, end: .detail)
case colors(start: GradientVariant, end: GradientVariant)
```
## Installation
### CocoaPods
ComplimentaryGradientView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
### Swift 4.2
```ruby
pod 'ComplimentaryGradientView', '~> 3.0'
```
### Swift3.
```ruby
pod 'ComplimentaryGradientView', '~> 0.1.7'
```
### Swift 2.2
```ruby
pod 'ComplimentaryGradientView', '~> 0.1.0'
```
### Manually
Download and drop `ComplimentaryGradientView.xcodeproj` into your project
OR
Drag `Source` folder into your project.
## Dependencies
## License
ComplimentaryGradientView is available under the MIT license. See the LICENSE file for more info.