/SwiftColorPicker

An iOS HSB color picker implemented in Swift

Primary LanguageSwiftMIT LicenseMIT

SwiftColorPicker

Swift Color Picker Screenshot

##Installation ###CocoaPod Podfile:

use_frameworks!
pod 'SwiftColorPicker'

##Usage ###Simple Example Create a Storyboard with 3 views and set the Classes to ColorWell (UIButton), ColorPicker (UIView) and HuePicker (UIView). Wire the Outlets with the following code:

import SwiftColorPicker

...

@IBOutlet var colorWell:ColorWell?
@IBOutlet var colorPicker:ColorPicker?
@IBOutlet var huePicker:HuePicker?

...
// Setup
pickerController = ColorPickerController(svPickerView: colorPicker!, huePickerView: huePicker!, colorWell: colorWell!)
pickerController?.color = UIColor.redColor()

// get color:
pickerController!.color

// get color updates:
pickerController?.onColorChange = {(color, finished) in
    if finished {
      self.view.backgroundColor = UIColor.whiteColor() // reset background color to white
    } else {
        self.view.backgroundColor = color // set background color to current selected color (finger is still down)
    }
}

##License MIT-License