Skip to content

Commit 5916f1d

Browse files
committed
[css-color-5] Fix color-mix() grammar, drop <number>, allow adjusters/percentage per component
1 parent b55522f commit 5916f1d

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

css-color-5/Overview.bs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,32 +88,35 @@ Mixing colors: the ''color-mix()'' function {#color-mix}
8888

8989

9090
<pre class='prod'>
91-
<dfn>color-mix()</dfn> = color-mix( <<color>> <<color>> [ <<number>> | <<percentage>> |
92-
[ [=color-adjuster=] [=colorspace=]? ]?] )
91+
<dfn>color-mix()</dfn> = color-mix(<<colorspace>>?, <<mix-component>>#{2})
9392
</pre>
9493

9594
<pre class='prod'>
96-
<dfn>colorspace</dfn> = srgb | hsl | hwb | xyz | lab | lch
95+
<dfn>&lt;mix-component></dfn> = <<color>> [ <<percentage>> | <<color-adjuster>>+ ]?
9796
</pre>
9897

9998
<pre class='prod'>
100-
<dfn>color-adjuster</dfn> = <<rgb-adjuster>> | <<hsl-adjuster>> | <<hwb-adjuster>> | <<xyz-adjuster>> | <<lab-adjuster>> | <<lch-adjuster>>
101-
<dfn>srgb-adjuster</dfn> = red | green | blue
102-
<dfn>hsl-adjuster</dfn> = <<hue-adjuster>> | saturation | lightness
103-
<dfn>hwb-adjuster</dfn> = <<hue-adjuster>> | whiteness | blackness
104-
<dfn>xyz-adjuster</dfn> = x | y | z
105-
<dfn>lab-adjuster</dfn> = lightness | a | b
106-
<dfn>lch-adjuster</dfn> = lightness | chroma | <<hue-adjuster>>
107-
<dfn>hue-adjuster</dfn> = hue [shorter | longer | increasing | decreasing ]?
99+
<dfn>&lt;colorspace></dfn> = srgb | hsl | hwb | xyz | lab | lch
100+
</pre>
101+
102+
<pre class='prod'>
103+
<dfn>&lt;color-adjuster></dfn> = <<rgb-adjuster>> | <<hsl-adjuster>> | <<hwb-adjuster>> | <<xyz-adjuster>> | <<lab-adjuster>> | <<lch-adjuster>>
104+
<dfn>&lt;srgb-adjuster></dfn> = red || green || blue
105+
<dfn>&lt;hsl-adjuster></dfn> = <<hue-adjuster>> || saturation || lightness
106+
<dfn>&lt;hwb-adjuster></dfn> = <<hue-adjuster>> || whiteness || blackness
107+
<dfn>&lt;xyz-adjuster></dfn> = x || y || z
108+
<dfn>&lt;lab-adjuster></dfn> = lightness || a || b
109+
<dfn>&lt;lch-adjuster></dfn> = lightness || chroma || <<hue-adjuster>>
110+
<dfn>&lt;hue-adjuster></dfn> = hue [shorter | longer | increasing | decreasing | specified ]?
108111
</pre>
109112

110113
When no [=colorspace=] is specified,
111114
the mixing is done in the ''lch'' colorspace.
112115

113-
When a plain number or percentage is specified (without a [=color-adjuster=]),
116+
When a percentage is specified (without a [=color-adjuster=]),
114117
it applies to all color channels in the given [=colorspace=] equally.
115118

116-
If the plain number or percentage is omitted,
119+
If the percentage is omitted,
117120
it defaults to 50% (an equal mix of the two colors).
118121

119122
The [=xyz=] colorspace is CIE XYZ, with a D50 whitepoint, and allows computation to be done

0 commit comments

Comments
 (0)