Closed georggrubner closed 2 years ago
Hi!
Not sure it's a bug: a color with no saturation and lightness is black. Black doesn't have any hue since... you know... it's black :)
Well, we use colord for our color picker. As you can see, when you change the hue, color panel should change. This is only possible if we know the hue.
We had to implement a fix on our side, where we override the hue manually on the object colord gives us. This extra step should not be necessary. An HSL object passed to the colrd function should always be the same as the one we receive when calling toHsl()
As a developer of a color picker component, I would highly recommend storing the current hue in a separate variable.
You can't rely on color conversion libraries here since white, black and any grayscale color could break the conversion between color spaces.
This makes sense. Thanks for your help!
When creating an hsl object with a specific hue, but saturation an lightness set to 0, the hue will also be set to zero
test case:
this test will fail and the received result. The expected result is, that the hue stays the same.