Re: [csswg-drafts] [css-color-5] Behavior of `none` in relative color syntax (#10151)

>  I would err on the side of favoring the component meaning of none.

But what is that meaning in the context of math expressions?

A channel value of `none` is not the same as using `none` in a math expression.
Even when that `none` in a math expression originated from an origin color in relative color syntax.

I don't have any preference or objection. But I am really not seeing what `calc(none + 20)` is supposed to do or how authors are supposed to benefit from this.

Can you provide examples of inputs/outputs?

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

> > I took a weird turn somewhere and started imagining preserving `calc(none + 20)` resulting in `hsl(calc(none + 20) 50% 50%)` as the final value.
> Er, yes, that is the correct final value. Obviously, that is not useful by itself, but it becomes concrete once you interpolate.

How?

For example :

```
color-mix(
  in hsl,
  hsl(from hsl(none 50% 50%) calc(h + 20) s l),
  hsl(50deg 50% 50%)
)
```

What is result of this?

A: 
1. `calc(h + 20)` is `0 + 20`
2. interpolated as `(20 + 50) / 2`
3. results in `hsl(35deg 50% 50%)`

B: 
1. `calc(h + 20)` is `none`
2. interpolated as `(50 + 50) / 2`
3. results in `hsl(50deg 50% 50%)`

C: 
1. `calc(h + 20)` remains `calc(none + 20)`
2. interpolated as ???
3. results in ???

Also keep in mind that there should be any practical difference between manually writing `none` and channel keywords.

```css
hsl(from hsl(none 50% 50%) calc(h + 20) s l)
hsl(calc(none + 20) s l)
```

```css
--foo: calc(none + 20)
hsl(var(--foo) s l)
```


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


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

Received on Sunday, 14 April 2024 10:12:07 UTC