Possible Duplicate:
Algorithm to convert RGB to HSV and HSV to RGB?
Can someone explain on how to convert an HSV value to an RGB when the value is 0 to 255? Also,
For reference, I am trying to do this in C++.
Possible Duplicate:
Algorithm to convert RGB to HSV and HSV to RGB?
Can someone explain on how to convert an HSV value to an RGB when the value is 0 to 255? Also,
For reference, I am trying to do this in C++.
Found it here http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
Edit:
I once wrote a color picker and used to understand all these. Back then, I looked at photoshop color picker, tried moving around the cross hair, observe the changes in hsv/rgb numbers and figured out how they work. In this case
i
seems to locate at which point the main color, hue, is pointed it. The value of hue is actually a degree of fully saturated colors in cycle which starts with red and ends with red. There's a triangle with each point representing R,G and B where 0 degree is R. Between R and G, it's Yellow, between R and B, it's Magenta and between B and G, it's cyan. There we have total 6 colors. Those 6 colors are from case 0 through 5.