Reputation: 2069
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'.
Upvotes: 3
Views: 1962
Reputation: 28864
The BNColor class might be useful for you. This includes conversions between HSV and RGB, among other features.
Upvotes: 0
Reputation: 1793
Try working with the HSV or HSL color spaces. You can have the value/lightness or saturation on the Y axis.
Upvotes: 1