Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone color picker

Tags:

cocoa

iphone

I'm trying to build a color picker view on the iPhone. I want to draw one of those 'color maps' and let the user tap on the color. I can create a gradient (in the X axis) ok which gives me the color range, but I also want to combine the lightness (in the Y axis) which is where I'm struggling.

Any help would be most welcome.

Thanks

PS: I've seen the example at http://www.v-vent.com/blog/?p=27 but this uses a colormap png file which is not very 'smooth'.

like image 326
Scotty Avatar asked Dec 03 '25 05:12

Scotty


1 Answers

Try working with the HSV or HSL color spaces. You can have the value/lightness or saturation on the Y axis.

like image 108
Daniel Dinu Avatar answered Dec 04 '25 19:12

Daniel Dinu