Re: [csswg-drafts] propose a `hexa()` function that mirrors `rgba()` functionality for hex color codes (#7327)

Also note that [CSS Color 4 introduced a way to express alpha values in hex colors](https://drafts.csswg.org/css-color/#hex-notation) via a four- and eight-digit syntax.

E.g. the semi-transparent red from your example can be expressed via `#ff000064`. The good news is that you can already use this syntax today, as it is already available in all browsers for some time. The bad news is that you can't use it together with custom properties.

Though as @Loirooriol pointed out, this will be possible using relative colors. Applying that syntax to your example, this looks like

```css
--my-color-red: #ff0000;
background: rgb(from var(--my-color-red) r g b / 0.5);
```

Sebastian

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


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

Received on Saturday, 28 May 2022 20:39:58 UTC