We have HSVToRGB, can we not have HSLToRGB?!
Maybe it is less used since HSV is often in color wheels, but the L value makes more sense in a way!
(personally I have trouble with HSV since you can not choose a color (hue/saturation) and then modify the light & dark to shade an object)
They are not the same, but almost. The only difference is how V or L is calculated. V is max(R,G,B) while L is (max(R,G,B) + min(R,G,B)) / 2. So L is the relative “lightness”. There are countless of different color spaces out there and Unity provides HSV conversion (note: not even from the very beginning. Can’t remember when they added the methods, though quite some time ago). Unity can not provide conversion from / to all potential color spaces. HSV is easier to calcuate, especially in reverse (HSV->RGB).
If you really need it, you can implement those conversions yourself. It’s not black magic, you know The wikipedia article has some conversion logic you can look up. Or you simply search for a ready-to-use or easy-to-adapt solution
Unity 5.3 I think all the way back in 2015. I doubt that type has changed in all the years since. I’d be happy to mention it to some of the internal devs who work on low-hanging fruit but that’s no guarantee it’ll get added. All I can do though.
Thanks - I have code to do it, it is only a nice to have so I guess bigger priorities!!
But I am starting to question HSV’s heavy use - HSL means you can change from a light to dark version of a colour more easily than HSV (also called HSB perhaps as V/brightness is from black to full rgb of color)
Well almost - the ranges seem different like HSL 1,.5,1, HSV, 1,1,.5.
because at full hue brightness (L = 0.5 or V = 1) the saturation ends at mid-grey in HSL and white in HSV.
Is there a 1,1,1 version so you can combine both!!