css-color-function
css-color-function copied to clipboard
Incorrect working HSL/HWB adjustments when color hue angle is null
Test case:
it('should correctly subtract whiteness when hue angle is null', function () {
convert('white whiteness(- 20%)', 'rgb(204, 204, 204)'); // hwb(0, 80%, 20%)
});
https://github.com/postcss/postcss-color-function/issues/40
From spec: (https://drafts.csswg.org/css-color/#hsl-hwb-adjusters)
If the hue angle is null, the operation is
w(),white(),b(), orblack(), and the adjuster would make the sum of whiteness and blackness less than 100%, it additionally adjusts the opposite HWB channel to make the sum equal to 100%. (That is,color(white w(- 20%))would represent the same color ashwb(0, 80%, 20%).)