Convert HSB/HSV color to HSL
Ho do I convert HSB color to HSL? Photoshop shows HSB color in its color picker. HSL color can be used in CSS. I tried this JS: function hsb2hsl(h, s, b) { return { h: h, s: s, l: b-s/2 } } But hsb2hsl(0, 100, 50).l == 0 instead of 25 Update: Can I do that without converting HSB → RGB → HSL? I'm afraid my Javascript knowledge is lacking, but you should be able to infer the conversion from http://ariya.blogspot.com/2008/07/converting-between-hsl-and-hsv.html Let's picture what actually are H SB (V), H SL , and how are constructed: Hue color value goes from 0 to 360 degrees (where 0 is red ) for