kongtomorrow/TunableSpec — pull request #7 by chrisbrandow (2014-09-08 19:14:29+00:00)
Title: additions of a color slider: _KFColorSilderSpecItem

## Chris Brandow Notes 2014-09-08

#### Usage
1. A color can be modified with a single slider. Color components are tuned with a slider one at a time. The user switches between components by long-pressing on the slider.
1. Color sliders can be initiated from JSON with either a comma-delimited list of 0-1 or 0-255 rgb values, or with a hex string. No slider minimums or maximums are given.
1. Output is an array of 4 strings, to ease possible copying and pasting into other development tools.

sample JSON:
{
"colorValue" : "0.58, 0., 0.28, 1",
"key" : "aColor",
"label" : "viewBG"
}, {
"colorValue" : "45, 124, 100",
"key" : "Color",
"label" : "shapeBG"
}, {
"colorValue" : "#39CCCC",
"key" : "bColor",
"label" : "shapeBorder"
}

sample output:

{
"key" : "Color",
"label" : "shapeBack",
"colorValue" : [
"#717C64, Alpha: 1.000",
"113, 124 100, Alpha: 1.000",
"0.444, 0.486, 0.392, Alpha: 1.000",
"[UIColor colorWithRed:0.444 green:0.486 blue:0.392 alpha:1.000]"
]
}

#### interacts in code as follows:

`- (UIColor *)colorForKey:(NSString *)key`
`- (void)withColorForKey:(NSString *)key owner: (id)weaklyHeldOwner maintain:(void (^)(id owner, UIColor
*flag))maintenanceBlock`