[csswg-drafts] [css-color-5] Hue interpolation when using 2 different normalization strategies (#5964)

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

== [css-color-5] Hue interpolation when using 2 different normalization strategies ==
In the [CSS Color Module 5 color-mix spec](https://drafts.csswg.org/css-color-5/#color-mix), it allows for both arguments of the function to be hue interpolated with _different_ normalization strategies. For example:

```css
color-mix(lch(52% 58.1 257.1) hue shorter 75.23%, lch(56% 49.1 22.7) hue decreasing 24.77%);
```

In this case, the shorter interpolation strategy is applied to the first color, giving us:
```
h1 = 257.1, h2 = 22.7
h2 - h1 = 22.7 - 257.1 = -229 < -180
```
The [css-color-4 spec](https://drafts.csswg.org/css-color-4/#hue-interpolation) states that in the case where `h2 - h1 < -180`, `h2 += 360`. It is unclear to me if the 360 addition to the second color's hue should be ignored entirely, added before the second interpolation is applied, or added after the second interpolation is applied. If the value is not ignored, can the second algorithm then affect the hue of the first color? Continuing the example, using the decreasing strategy:

```
h1 = 22.7, h2 = 257.1
h1 < h2
```
So we need to add 360 back to the first color's hue. Would this affect the second color again (as in, would we need to reapply the "shorter" interpolation again)? Could this result in an infinite loop?

Sorry if this is unclear I did my best explaining it but I definitely could be missing something. Thanks for reading!

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


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

Received on Tuesday, 9 February 2021 15:46:20 UTC