Colory 0.1.5

Colory 0.1.5

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2018
SPMSupports SPM

Maintained by Tony Li.



Colory 0.1.5

Colory

Swift 3, 4 Build Status CocoaPods Compatible Carthage License

A UIControl for picking color from HSB color palette.

Screenshot

P.S. Gradient looks way smoother on device than this gif.

Installation

CocoaPods

To install Colory using CocoaPods, add following line to your Podfile:

pod 'Colory'

Carthage

To install Colory using 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.

let pickerView = ColorPickerView()
pickerView.addTarget(self, action: #selector(colorChanged(_:)), for: .valueChanged)

Use color property to get and set currently picked color.

@objc func colorChanged(_ pickerView: ColorPickerView) {
    update(with: pickerView.color)
}

Use layoutMargins to customize palette margins.

pickerView.layoutMargins = UIEdgeInsets(top: pickerView.layoutMargins.top,
                                        left: 20,
                                        bottom: pickerView.layoutMargins.bottom,
                                        right: 20)

LICENSE

This library is released under MIT License.