cssstyle icon indicating copy to clipboard operation
cssstyle copied to clipboard

HSL to RGB conversion results in black

Open ianschmitz opened this issue 4 years ago • 0 comments

The logic for converting HSL to RGB appears to be flawed: https://github.com/jsdom/cssstyle/blob/b527ed722364dc6d156487c652df100572075dee/lib/utils/colorSpace.js#L13-L21

It refers to the W3 suggested logic for converting HSL to RGB, but their logic says that it expects the hue value to be normalized to a [0, 6) value which the logic in this package doesn't appear to do.

For example parsing:

hsl(85, 100%, 40%)

returns:

rgb(0, 0, 0)

ianschmitz avatar Jul 05 '21 22:07 ianschmitz