Re: [csswg-drafts] [css-color-4] Clarify that `none` is preserved in calculations (#10211)

I think of `missing`-ness as a flag on a color component.

`rgb(none 100 100)` has the `missing` flag set to `true` for `r` because it was written with an explicit `none`.

For `hsl(50deg 0 50%)` the `h` component has a value of `50deg` that is actually powerless as a result of having `0` saturation. **During color space conversion and interpolation** it has the imaginary `missing` flag set to `true`.

But I would argue that `h` in `hsl(calc(none * 2) 50%)` is not missing.
It is `none` containing (as you described it). For me this is potentially a distinct aspect, separate from missing components.

It would largely align, especially in simple cases:
```css
color-mix(in hsl, hsl(calc(20 + none) 50 50), hsl(50 50 50))
```

But does it align with missing components in non-trivial cases? :
```css
color-mix(in lch, hsl(30deg calc(none + 10) 50%), oklch(50% 50% 30deg))
```

```css
color-mix(in lch, hsl(30deg 50% 50%), oklch(50% 0.2 30deg))
```

Maybe this is an entirely new step in the interpolation process?

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

> If a color with a carried forward [missing component](https://drafts.csswg.org/css-color-4/#missing-color-component) is interpolated with another color which is not missing that component, the missing component is treated as having the other color’s component value.

-----------------------

`none` and missing components lose a lot of their utility in color space conversions when there aren't analogous components. 

`none` containing values might be extra sensitive to this because the calculation is carried forward and the value scales aren't the same for all color spaces.

`calc(none + 1)` means something completely different in `lch` for `c` than it does in `oklch`.

Do we want carry forward to align between missing components and `none` containing components in color space conversion?

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


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

Received on Wednesday, 24 April 2024 18:35:53 UTC