MixerBox
An iOS μ-framework featuring 2 HSB color pickers.
Setup
Cloning the project, dropping it into your workspace and linking to MixerBox.framework should make all required classes available.
$ git clone https://github.com/robertoseidenberg/MixerBox
To install via Carthage add the following line to your Cartfile:
github "https://github.com/robertoseidenberg/MixerBox" "v0.1"
Usage
See the included sample project for implementation details. MixerBox provides two UIView subclasses. Assigning those in InterfaceBuilder should suffice to make the views work.
// Displays all hues in a colorwheel manner and allows picking hue and saturation
public final class HSBView: ColorPickerView {
...
}
// Allows selection of saturation and lightness
public final class SBView: ColorPickerView {
...
}
Both views (when updated by the user) return values via delegate:
public protocol ColorPickerViewDelegate {
func colorPickerView(_ view: ColorPickerView, didSelectHSB hsb: HSB)
}
HSBView as well as SBView can be configured by setting each view's HSB value. They update accordingly.
public func setHSB(_ hsb: HSB, animated: Bool) {
...
}
Requirements
-
iOS 10
-
A metal compatible device
Notes
Since MixerBox is using Metal it does not work on the simulator! In fact it won't even compile for the simulator.