Re: [csswg-drafts] [css-color-5] Can "relative color syntax" channel constants be used for a channel other than the one it represents? (#6043)

The parsing difficulty is about the same in both cases, since you have to specify which identifiers are valid for each channel in the cases where not all the channels represent the same type (like lch for example, where l and alpha are percentages, c is a number and h is an angle). Here is a link to my implementation without support channel permutation in case you are interested: https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp#L1282 (though it still lacks the calc() support as I need to implement injecting identifiers into calc()).

Looks like the spec does have an example now with Example 9:

```css
--blue-into-gray: rgb(from var(--color)
                    calc(r * .3 + g * .59 + b * .11)
                    calc(r * .3 + g * .59 + b * .11)
                    calc(r * .3 + g * .59 + b * .11));
```

which seems reasonable enough. Thanks for the clarification.

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


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

Received on Tuesday, 2 March 2021 02:21:57 UTC