[csswg-drafts] [css-color-4] Does interpolation with achromatic colors truly have a "longer" arc? (#9436)

facelessuser has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-4] Does interpolation with achromatic colors truly have a "longer" arc? ==
This question is in relation to the recently closed issue: https://github.com/w3c/csswg-drafts/issues/9224.

Based on the conversation there, it appears it was determined that Chrome was handling logic for interpolation with undefined hues correctly. So this question is to specifically clarify the point in the title.

I realize the original question was specifically asking about "transparent" colors, but the resolution there I believe translates to achromatic colors in general. My personal opinion is that the resolution leads to unexpected results.

Consider the following example which interpolates a red color with black.

```
linear-gradient(to right in oklch longer hue, oklch(0.628 0.26 29.23), oklch(0 0 none / 1));
```

Results in Chrome

<img width="1675" alt="Screenshot 2023-10-04 at 6 27 50 AM" src="https://github.com/w3c/csswg-drafts/assets/1055125/cc11d954-6846-4326-8480-7eb8d055322f">

https://codepen.io/facelessuser/pen/MWZPmwy

Because the undefined hue is resolved to inherit the hue of the red color before the hue fix-up, we now get an interpolation around the entire color wheel, as if there was an arc between black and red. The reality is that achromatic colors have no hue; therefore, they have no arc between any hue.

Based on the conversation in https://github.com/w3c/csswg-drafts/issues/9224, my understanding is that this is indeed "correct" for CSS, even though it seems unintuitive, at least to me.

While Safari may be wrong in its implementation, it seems intuitive. In their case, it seems the undefined hue is not resolved until after the hue fix-up.

<img width="1680" alt="Screenshot 2023-10-04 at 6 34 19 AM" src="https://github.com/w3c/csswg-drafts/assets/1055125/ad0be9ab-ffd5-41a5-b480-c9263d174a91">

So, this is simply to clarify whether this behavior, conceptually, is truly the intention of the CSS spec or not, outside of which browser implemented the spec correctly.




Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9436 using your GitHub account


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

Received on Wednesday, 4 October 2023 12:39:57 UTC