Re: [csswg-drafts] [css-color-5] Grammar for parsing relative colors? (#7721)

> Oh, I see. I'm not sure the spec makes that obvious.

This is true for _every_ property: you can use `calc()` anywhere you want; the calculated result is what has to conform to the grammar.

I guess the place to make that explicit is in the CSS Custom Properties spec, and then with well-chosen examples for those values which are especially likely to be used with custom properties.

On the other hand I see your point; the impact of CSS Custom Properties is extensive, and we need to communicate this better. 

> The use of `calc()` and other math functions should already be subsumed into the definitions of `<number>` and `<percentage>` (and if they're not, that's a different conversation anyway).

Agreed.

> The problem lies in that the parameters to rgb() and its ilk are not defined individually, but using {3}. And while I recognize that this simplifies the definitions that require all three parameters to be of the same type, it does sort of relegate the channel keywords to something of an afterthought. 

Forbidding someone from using, say, the `r` value as part of the green channel, is more trouble than it is worth and there could be valid use cases (imagine someone doing custom chromatic adaptation by making each of the channels of `xyz-d65` be a weighted sum of `x`, `y` and `z` for example).

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


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

Received on Sunday, 18 September 2022 18:33:19 UTC