Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-color] Make the alpha optional in the *a() color functions too, …
…per resolution. Simplify grammar. Add note about aliasing.
- Loading branch information
Showing
1 changed file
with
13 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,8 +171,8 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3> | |
Its syntax is: | ||
|
||
<pre class='prod'> | ||
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} [, <<alpha-value>> ]? ) | ||
<dfn>rgba()</dfn> = rgba( <<rgb-component>>#{3} , <<alpha-value>> ) | ||
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} , <<alpha-value>>? ) | ||
<dfn>rgba()</dfn> = rgba( <<rgb-component>>#{3} , <<alpha-value>>? ) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
SebastianZ
Contributor
|
||
<dfn><rgb-component></dfn> = <<number>> | <<percentage>> | ||
<dfn><alpha-value></dfn> = <<number>> | <<percentage>> | ||
</pre> | ||
|
@@ -197,7 +197,6 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3> | |
|
||
Issue: The transfer function is undefined outside the range 0% to 100%. | ||
|
||
|
||
The final argument, the <<alpha-value>>, specifies the alpha of the color. | ||
If given as a <<number>>, the useful range of the value is ''0'' | ||
(representing a fully transparent color) | ||
|
@@ -209,6 +208,10 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3> | |
but are clamped to the ranges defined here at computed-value time. | ||
If omitted, it defaults to ''100%''. | ||
|
||
Note: For legacy reasons, the ''rgb()'' function and ''rgba()'' functions both exist, | ||
but are aliases of each other. | ||
Both of them allow specifying an RGB color with an optional alpha value. | ||
|
||
<h3 id='hex-notation'> | ||
The RGB hexadecimal notations: ''#RRGGBB''</h3> | ||
|
||
|
@@ -709,8 +712,8 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2> | |
The syntax of the ''hsl()'' function is: | ||
|
||
<pre class='prod'> | ||
<dfn>hsl()</dfn> = hsl( <<hue>>, <<percentage>>, <<percentage>> [, <<alpha-value>> ]? ) | ||
<dfn>hsla()</dfn> = hsla( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>> ) | ||
<dfn>hsl()</dfn> = hsl( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? ) | ||
<dfn>hsla()</dfn> = hsla( <<hue>>, <<percentage>>, <<percentage>>, <<alpha-value>>? ) | ||
<dfn><hue></dfn> = <<number>> | <<angle>> | ||
</pre> | ||
|
||
|
@@ -743,7 +746,7 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2> | |
but this specification does not define how to do so. | ||
|
||
The final argument specifies the alpha channel of the color. | ||
It's interpreted identically to the fourth argument of the ''rgba()'' function. | ||
It's interpreted identically to the fourth argument of the ''rgb()'' function. | ||
If omitted, it defaults to ''100%''. | ||
|
||
<div class='example'> | ||
|
@@ -771,6 +774,10 @@ HSL Colors: ''hsl()'' and ''hsla()'' functions</h2> | |
</pre> | ||
</div> | ||
|
||
Note: For legacy reasons, the ''hsl()'' function and ''hsla()'' functions both exist, | ||
but are aliases of each other. | ||
Both of them allow specifying an HSL color with an optional alpha value. | ||
|
||
|
||
<h3 id='hsl-to-rgb'> | ||
Converting HSL colors to RGB colors</h3> | ||
|
By reference this article, might the syntax is
<dfn>rgb()</dfn> = rgb( <<rgb-component>>#{3} [, <<alpha-value>> ]? )
?https://www.smashingmagazine.com/2016/05/understanding-the-css-property-value-syntax/#1-the-symbol