Hello,
I would like to build (or find) a function that can take RGB values and convert them to their HSB equivelents and vice versa. HSB stands for Hue, Saturation and Brightness (the 'B' is sometimes a 'V' for Value). People with Photoshop experience (and others) will probably know how these work. But for the uninitiated:
Hue represents the spectrum in 360 degrees, from Red through all the colors of the rainbow (color wheel) and back to Red again.
Saturation is the intensity or purity of the color. 100% is totally saturated and pure. 0% is totally grey.
Brightness is the relative lightness or darkness of the color, usually measured as a percentage from 0% (black) to 100% (white).
Although these are the "proper" definitions they aren't easy to verify when using any color sliders in my Adobe software. But regardless...
I want to be able to control the color with one or some of these three factors. For instance, if I have a middle-green which is rgb(70,170,50) or aprox. rgb(27%,67%,19%) and I want to get a lighter shade of that, for instance rgb(190,255,170), is there a way of doing this through any php function, and if not does anyone know the math or could point me towards a resource that has the math.
Another example would be to adjust the Hue by 180 degrees to get the complimentary color.
I know Adobe uses the Lab color model for all their internal color conversions, but I can't see how that would help me here!