Re: [csswg-drafts] [css-color-5] color-extract() function to extract individual color components (#6937)

Example of creating a new color with the alpha of one color and the components of another:
```css
--color3: lch(
 color-extract(lch l from var(--color1))
 color-extract(lch c from var(--color1))
 color-extract(lch h from var(--color1))
 /
 color-extract(lch alpha from var(--color2))
```

This makes me think of two obvious improvements:

- A syntax to extract multiple components, and have `color-extract()` return a sequence of tokens
- If the component is `alpha` it should not require a color space

These would bring it down to:

```css
--color3: lch(
 color-extract(lch l c h from var(--color1))
 /
 color-extract(alpha from var(--color2))
```

Note that in that case we need to either introduce some kind of separator, or disallow `from` as a component name.

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


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

Received on Wednesday, 12 January 2022 18:04:10 UTC