Re: [csswg-drafts] [css-color-5] Define the behavior of missing channels in the relative color syntax (#7771)

> While this needs to be copied over to L5 for clarity, the intention was option 2:
> 
> > For all other purposes, a [missing component](https://drafts.csswg.org/css-color-4/#missing-color-component) behaves as a zero value, in the appropriate unit for that component: 0, 0%, or 0deg. This includes rendering the color directly, converting it to another color space, _**performing computations on the color component values**_, etc.

This intention refers to general color manipulation. It was never considered directly how `none` should behave with RCS, which is why I asked Mia to create a new issue.

> I see three basic options:
> 
> 1. **Invalid operation**. This seems like the 'default' if we don't specify something different, since `none` is clearly not a valid number for `calc()`. However, I think it's not a very useful behavior, and we should avoid it if possible. In general, it seems bad to say 'some valid colors will simply break if you adjust them' - especially since `none` can result from internal CSS operations.
> 2. **Calculate with `0` in place of `none`**. This may be the most obvious choice, since it matches the behavior in other cases where we need a number value for `none`. But the results aren't necessarily useful, especially when the channel is truly powerless.
> 3. **The result is always `none`**. This was proposed by @nex3 as it maintains the intent of `none` to represent powerless or unimportant channels. Rotating a missing/powerless hue results in a hue that is still missing/powerless.
> 
> I'd propose that we go with option 3, but I could see arguments for the other approaches. Thoughts?

At first glance I agree that option 3 seems the most reasonable and more in line with the principle of least surprise. Option 2 (the current behavior) is not great. E.g. I think it's pretty surprising to end up with some sort of cyan for every complement that has a `none` hue!

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


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

Received on Wednesday, 21 September 2022 23:07:45 UTC