Color selection formula
i am trying to create a color-picker object in Flash. my question is not Flash specific coz its about the color selection itself. This is how its supposed to work:
There''s a square box of gradients with all the rainbow -like colours horizontally and intensity change vedrtically. Its just like the colour picker object within Flash itself.
Handling intensity is the easy part. I''m just having problems coming up with a formula that can extract the proper colour depending on the position the user clicks. Rite now, i''m using sin and cos formulas and they work to a certain degree but the slopes of these formulas are quadratic in nature. Observing the hexadecimal values for RGB representation, theres a fixed linear increase/decrease of values at specific intervals for each channel. sin and cos seem to be not very useful in that case.
anyone has a great way of handling this? i tried google but no proper luck there. Thanx in advance!
What Boops is getting at will make more sense with an examination of the color spaces that each model produces. HSL (Hue-Saturation-Luminence) lends itself more readily to a two dimensional representation than does RGB.
I use the HSL color space in my color picker.
The conversions can be found in for example
"Computer Graphics: Principles & Practice"
Foley,Van Dam
The conversions can be found in for example
"Computer Graphics: Principles & Practice"
Foley,Van Dam
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement