css-color-function icon indicating copy to clipboard operation
css-color-function copied to clipboard

Incorrect working HSL/HWB adjustments when color hue angle is null

Open Semigradsky opened this issue 8 years ago • 0 comments

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(), or black(), 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 as hwb(0, 80%, 20%).)

Semigradsky avatar Nov 03 '17 13:11 Semigradsky