https://github.com/crazytonyli/colory
A `UIControl` for picking color from HSB color palette.
https://github.com/crazytonyli/colory
carthage cocoapods color hsb hsb-color-palette ios picker rgb swift
Last synced: 11 months ago
JSON representation
A `UIControl` for picking color from HSB color palette.
- Host: GitHub
- URL: https://github.com/crazytonyli/colory
- Owner: crazytonyli
- License: mit
- Created: 2017-09-21T11:28:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-17T07:09:27.000Z (over 7 years ago)
- Last Synced: 2025-03-20T15:22:18.111Z (about 1 year ago)
- Topics: carthage, cocoapods, color, hsb, hsb-color-palette, ios, picker, rgb, swift
- Language: Swift
- Size: 2.14 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Colory

[](https://travis-ci.org/crazytonyli/Colory)
[](https://cocoapods.org/pods/Colory)

[](https://github.com/crazytonyli/Colory/blob/master/LICENSE)
A `UIControl` for picking color from HSB color palette.

P.S. Gradient looks way smoother on device than this gif.
## Installation
### CocoaPods
To install Colory using [CocoaPods](https://cocoapods.org), add following line to your Podfile:
pod 'Colory'
### Carthage
To install Colory using [Carthage](https://github.com/Carthage/Carthage), add following line to your Cartfile:
github "crazytonyli/Colory"
## Usage
Colory has very simple API.
Register action with `valueChanged` event to receive picked color changes.
```swift
let pickerView = ColorPickerView()
pickerView.addTarget(self, action: #selector(colorChanged(_:)), for: .valueChanged)
```
Use `color` property to get and set currently picked color.
```swift
@objc func colorChanged(_ pickerView: ColorPickerView) {
update(with: pickerView.color)
}
```
Use `layoutMargins` to customize palette margins.
```swift
pickerView.layoutMargins = UIEdgeInsets(top: pickerView.layoutMargins.top,
left: 20,
bottom: pickerView.layoutMargins.bottom,
right: 20)
```
## LICENSE
This library is released under [MIT License](LICENSE).