[csswg-drafts] [css-color-5] Make channel values in relative color syntax optional (#10689)

SebastianZ has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-5] Make channel values in relative color syntax optional ==
To reduce complexity for adding transparency to a color (see #10678), the channel values should be made optional, as suggested by @romainmenke.

So, the syntax of the `rgb()` function as an example would then be

```ebnf
<modern-rgb-syntax> = rgb( [ from <color> ]?
        [ <number> | <percentage> | none]{3}?
        [ / [<alpha-value> | none] ]?  )
```

allowing to define a semi-transparent black as `rgb(from black / 0.5)`.

The syntax above also allows to define `rgb(from black)`, which might not be useful by itself. If we decide to enforce one of the components to be there, the syntax may then look like


```ebnf
<modern-rgb-syntax> = rgb( [ from <color> ]?
        [ [ <number> | <percentage> | none]{3}?
        [ / [<alpha-value> | none] ]? ]!  )
```

Sebastian

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10689 using your GitHub account


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

Received on Monday, 5 August 2024 12:10:07 UTC