Skip to content

Commit 42eaa4d

Browse files
author
Chris Lilley
committed
[css-color-5] Non-RCS modern rgb & rgba also allows mixed num-pct w3c#8231
1 parent 13d4de9 commit 42eaa4d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

css-color-4/Overview.bs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ Modern (Space-separated) Color Function Syntax</h4>
894894
* minimum required precision <a href="#serializing-color-values">when serializing</a> is defined,
895895
and may be greater than 8 bits per component
896896
* the ''none'' value is allowed, to represent [=missing components=]
897+
* components using <<percentage>> and <<number>> may be freely mixed
897898

898899
<div class=example id="example-modern-syntax">
899900
<p>The following represents a saturated sRGB red that is 50% opaque:
@@ -920,6 +921,8 @@ Legacy (Comma-separated) Color Function Syntax</h4>
920921
(optionally preceded and/or followed by whitespace)
921922
* minimum required precision is lower, 8 bits per component
922923
* the ''none'' value is not allowed
924+
* components must be specified using either all-<<percentage>>
925+
or all-<<number>>, they can not be mixed.
923926

924927
<div class=example id="example-rgba-legacy">
925928
<p>The following represents a saturated sRGB red that is 50% opaque:

css-color-5/Overview.bs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,17 +1003,16 @@ However, if calculations are done on missing values, ''none'' is treated as 0.
10031003

10041004
<h3 id="relative-RGB">Relative sRGB Colors</h3>
10051005

1006-
The grammar of the ''rgb()'' function is extended as follows:
1006+
The grammar of the [=modern color syntax=] ''rgb()'' and ''rgba()'' functions are extended as follows:
10071007

10081008
<pre class='prod'>
1009-
<dfn>rgb()</dfn> = rgb( [<<percentage>> | none]{3} [ / [<<alpha-value>> | none] ]? ) |
1010-
rgb( [<<number>> | none]{3} [ / [<<alpha-value>> | none] ]? ) |
1011-
rgb( [ from <<color>> ]? [ <<number>> | <<percentage>> | none]{3} [ / [<<alpha-value>> | none] ]? )
1009+
<dfn>rgb()</dfn> = rgb( [ from <<color>> ]? [ <<number>> | <<percentage>> | none]{3} [ / [<<alpha-value>> | none] ]? )
1010+
<dfn>rgba()</dfn> = rgba( [ from <<color>> ]? [ <<number>> | <<percentage>> | none]{3} [ / [<<alpha-value>> | none] ]? )
10121011
<dfn>&lt;alpha-value></dfn> = <<number>> | <<percentage>>
10131012
</pre>
10141013

10151014

1016-
Within a [=relative color=] syntax ''rgb()'' function,
1015+
Within a [=relative color=] syntax ''rgb()'' or ''rgba()'' function,
10171016
the allowed [=channel keywords=] are:
10181017

10191018
* <dfn value for="rgb()">r</dfn>, <dfn value for="rgb()">g</dfn>, and <dfn value for="rgb()">b</dfn>

0 commit comments

Comments
 (0)