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

> was interpreted to mean that conversion always happened for interpolation, even when it was to the same color space, and so powerless components became missing. Tab may have a better source for that than my memory.

This however isn't correct for the current specification, which literally states that conversion only happens when required. So maybe the wording needs to change?

https://drafts.csswg.org/css-color/#interpolation

emphasis mine :

> Interpolation between <color> values occurs by first checking the two colors for analogous components which will be carried forward; then **(if required)** converting them to a given color space which will be referred to as the interpolation color space below, and then linearly interpolating each component of the computed value of the color separately.

I've updated our implementation so that conversion always happens, even when the input and output color space are the same. This effectively removes the difference between `powerless` and `missing` in the context of interpolation.

As far as I can tell this gives better results when interpolating between any color and white/black/... when both are described in a cylindrical polar color model.

You can play around with this here : https://preset-env.cssdb.org/blog/css-color-parser-v1.0.0/

I've also added an output in `oklch` format.


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


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

Received on Monday, 28 August 2023 16:38:17 UTC