Re: [csswg-drafts] [css-color-4] [css-color-5] inconsistent mentions of powerless components in `white`. (#8609)

As far as the topic of demonstrating proper conversion and interpolation, both libraries support the features to demonstrate correct results if configured correctly. They may not demonstrate browser "automatic" behavior unless you configure the statements correctly. So don't let your assumptions about browsers fool you into thinking they are not correct, they just don't automatically do what browsers do by default. I don't maintain Color.js and only use Color.js casually, so I cannot speak to whether there are bugs, but as far as the current topic is concerned, it appears to be correct.

> The specification states that hue is powerless when chroma is 0%.
I don't understand how you get a hue of 30deg here :

Let me clear something up. My library will not assume hue is powerless like CSS does when an explicit hue is provided (conversion may cause a hue to go powerless). So I am _not_ demonstrating how a browser should handle chroma. What I am demonstrating is the claim that your results are treating hue has powerless is not correct. If it was treating hue as powerless you would have had something _approximately_ close to `rgb(226.44 146.99 171.23)`, not `rgb(230.28 149.72 136.2)`.

That is my statement. I demonstrate this by showing an example with an explicit hue that is not being treated as powerless and one where it is.

> Can you provide reproducible examples?

Yes, put this into https://colorjs.io/notebook/. And you will get your RGB results, but with an OkLCh hue of 30.

```js
let color1 = new Color("oklch(75% 0% 60deg)");
let color2 = new Color("oklch(75% 50% 0deg)");
let notPowerless = color1.mix(color2, {space: 'oklch'});
notPowerless.to('srgb').toGamut({method: 'oklch.chroma'});
color1.set('hue', NaN);
let powerless = color1.mix(color2, {space: 'oklch'});
powerless.to('srgb').toGamut({method: 'oklch.chroma'});
```

You will have to convert the percent values to non-percent, but you will see it matches my results.

> Are these tools you mention up to date with the latest specification?

It depends on what part of the specification you are talking about.

Color.js behaves in a similar way as my library, so explicit, user defined hues will not be treated as undefined unless a conversion causes them to be undefined. So don't assume browser behavior in this sense, but the logic of the statements is correct.

Color.js does not support `none` yet, but my library does.  Color.js does not support carryforward when interpolation, mine does as an experimental, undocumented feature that must be enabled.

While my goal is not to mirror the browser behavior, I am able to demonstrate it when required.







-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8609#issuecomment-1688205093 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 22 August 2023 13:36:21 UTC