|
: (max - light) / Math.min(light, 1 - light); |
rgbToHsl(1.5, 1, 1)
// (3) [0, -100, 125]
This only happens when the sum of all channels exceeds 3.
rgbToHsl(1.5, 1, 0.5) -> negative saturation
rgbToHsl(1.499999, 1, 0.5) -> very high, but positive saturation of 99999900
I get better results when I clamp saturation to 0.
I don't know if clamping to 0 had unintended side effects here.
csswg-drafts/css-color-4/rgbToHsl.js
Line 16 in 61da22e
This only happens when the sum of all channels exceeds
3.rgbToHsl(1.5, 1, 0.5)-> negative saturationrgbToHsl(1.499999, 1, 0.5)-> very high, but positive saturation of99999900I get better results when I clamp saturation to
0.I don't know if clamping to
0had unintended side effects here.