Skip to content

Commit 156c0aa

Browse files
committed
[css-color] Make the alpha optional in the *a() color functions too, per resolution. Simplify grammar. Add note about aliasing.
1 parent bf5a90d commit 156c0aa

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

css-color/Overview.bs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3>
171171
Its syntax is:
172172

173173
<pre class='prod'>
174-
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} [, <<alpha-value>> ]? )
175-
<dfn>rgba()</dfn> = rgba( <<rgb-component>>#{3} , <<alpha-value>> )
174+
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} , <<alpha-value>>? )
175+
<dfn>rgba()</dfn> = rgba( <<rgb-component>>#{3} , <<alpha-value>>? )
176176
<dfn>&lt;rgb-component></dfn> = <<number>> | <<percentage>>
177177
<dfn>&lt;alpha-value></dfn> = <<number>> | <<percentage>>
178178
</pre>
@@ -197,7 +197,6 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3>
197197

198198
Issue: The transfer function is undefined outside the range 0% to 100%.
199199

200-
201200
The final argument, the <<alpha-value>>, specifies the alpha of the color.
202201
If given as a <<number>>, the useful range of the value is ''0''
203202
(representing a fully transparent color)
@@ -209,6 +208,10 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3>
209208
but are clamped to the ranges defined here at computed-value time.
210209
If omitted, it defaults to ''100%''.
211210

211+
Note: For legacy reasons, the ''rgb()'' function and ''rgba()'' functions both exist,
212+
but are aliases of each other.
213+
Both of them allow specifying an RGB color with an optional alpha value.
214+
212215
<h3 id='hex-notation'>
213216
The RGB hexadecimal notations: ''#RRGGBB''</h3>
214217

@@ -709,8 +712,8 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
709712
The syntax of the ''hsl()'' function is:
710713

711714
<pre class='prod'>
712-
<dfn>hsl()</dfn> = hsl( <<hue>>, <<percentage>>, <<percentage>> [, <<alpha-value>> ]? )
713-
<dfn>hsla()</dfn> = hsla( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>> )
715+
<dfn>hsl()</dfn> = hsl( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? )
716+
<dfn>hsla()</dfn> = hsla( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? )
714717
<dfn>&lt;hue></dfn> = <<number>> | <<angle>>
715718
</pre>
716719

@@ -743,7 +746,7 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
743746
but this specification does not define how to do so.
744747

745748
The final argument specifies the alpha channel of the color.
746-
It's interpreted identically to the fourth argument of the ''rgba()'' function.
749+
It's interpreted identically to the fourth argument of the ''rgb()'' function.
747750
If omitted, it defaults to ''100%''.
748751

749752
<div class='example'>
@@ -771,6 +774,10 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2>
771774
</pre>
772775
</div>
773776

777+
Note: For legacy reasons, the ''hsl()'' function and ''hsla()'' functions both exist,
778+
but are aliases of each other.
779+
Both of them allow specifying an HSL color with an optional alpha value.
780+
774781

775782
<h3 id='hsl-to-rgb'>
776783
Converting HSL colors to RGB colors</h3>

0 commit comments

Comments
 (0)