Temple of The Roguelike Forums
Development => Programming => Topic started by: Krice on January 14, 2019, 08:36:12 AM
-
Just google it, right? Wrong. I can't find a C++ code for HSL-RGB and back conversion that actually works. I think I can get RGB to HSL work, because the values seem to be ok, but back to RGB fails.
-
Never mind, it did work, I was just using too large increments for saturation and lightness. Also, my Range class wasn't working so it didn't clamp values to 1.0, but went slightly over it. Great stuff. And even if it does work my HSV selector routine still needs to figure out what to do when saturation or lightness are zero (there is no hue information). In HSV colorspace case I'm picking the top right color of the selector which is the "pure" hue of the color, but it doesn't work with HSL, because the way lightness works compared to "value" of HSV.