Skip to content

Commit 56eaaa6

Browse files
committed
[css-color-4] Use <dashed-ident> for non-predefined colorspaces, fix w3c#4654
1 parent 75447e4 commit 56eaaa6

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

css-color-4/Overview.bs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,30 +2081,33 @@ Profiled, Device-dependent Colors</h2>
20812081

20822082
<div class='example'>
20832083
This example specifies four profiled colors:
2084-
for a standard SWOP-coated CMYK press,
2085-
for a wide-gamut seven-ink printer,
2086-
for ProPhoto RGB,
2087-
and for the display-p3 standard RGB space.
2084+
two are custom spaces
2085+
(for a SWOP-coated CMYK press,
2086+
for a wide-gamut seven-ink printer),
2087+
the other two are predefined spaces
2088+
(the ProPhoto RGB,
2089+
and display-p3 RGB spaces).
20882090
In each case, the numerical parameters
20892091
are in the range 0.0 to 1.0
20902092
(rather than, for example, 0 to 255).
20912093
<!-- add examples with alpha, and with fallback -->
20922094
<pre>
2093-
color: color(swopc 0.0134 0.8078 0.7451 0.3019);
2094-
color: color(indigo 0.0941 0.6274 0.3372 0.1647 0 0.0706 0.1216);
2095+
color: color(--swopc 0.0134 0.8078 0.7451 0.3019);
2096+
color: color(--indigo 0.0941 0.6274 0.3372 0.1647 0 0.0706 0.1216);
20952097
color: color(prophoto-rgb 0.9137 0.5882 0.4784);
20962098
color: color(display-p3 0.3804 0.9921 0.1412);
20972099
</pre>
20982100

20992101
The colors not using a <a href="#predefined">predefined</a> colorspace
2102+
are distinguished by their use of <<dashed-ident>> and
21002103
also need a matching ''@color-profile'' at-rule
21012104
somewhere in the stylesheet,
21022105
to connect the name with the profile data.
21032106

21042107
<pre>
2105-
@color-profile swopc {
2108+
@color-profile --swopc {
21062109
src: url('http://example.org/swop-coated.icc');}
2107-
@color-profile indigo {
2110+
@color-profile --indigo {
21082111
src: url('http://example.org/indigo-seven.icc');}
21092112
</pre>
21102113
</div>
@@ -2117,7 +2120,7 @@ Profiled, Device-dependent Colors</h2>
21172120
Its syntax is:
21182121

21192122
<pre class='prod'>
2120-
<dfn>color()</dfn> = color( [ <<ident>>? [ <<number-percentage>>+ | <<string>> ] [ / <<alpha-value>> ]? ]# , <<color>>? )
2123+
<dfn>color()</dfn> = color( [ [<<ident>> | <<dashed-ident>>]? [ <<number-percentage>>+ | <<string>> ] [ / <<alpha-value>> ]? ]# , <<color>>? )
21212124
</pre>
21222125

21232126
The color function takes one or more comma-separated arguments,
@@ -2127,13 +2130,14 @@ Profiled, Device-dependent Colors</h2>
21272130

21282131
Each argument has the following form:
21292132

2130-
* An optional <<ident>> denoting the colorspace.
2131-
This can be one of the predefined colorspaces
2132-
(such as ''display-p3''),
2133-
or one defined by a ''@color-profile'' rule.
2133+
* An optional <<ident>> or <<dashed-ident>> denoting the colorspace.
2134+
If this is an <<ident>> it denotes one of the predefined colorspaces
2135+
(such as ''display-p3'');
2136+
if it is a <<dashed-ident>> it denotes a custom
2137+
colorspace, defined by a ''@color-profile'' rule.
21342138
If omitted, it defaults to the predefined ''srgb'' color profile.
21352139

2136-
If the <<ident>> names a non-existent colorspace,
2140+
If the <<ident>> or <<dashed-ident>> names a non-existent colorspace,
21372141
this argument represents an <a>invalid color</a>.
21382142

21392143
* Either one or more <<number>>s or <<percentage>>s providing the parameter values that the colorspace takes,
@@ -2425,14 +2429,15 @@ Specifying a color profile: the ''@color-profile'' at-rule</h3>
24252429
It's defined as:
24262430

24272431
<pre class='prod'>
2428-
@color-profile = @color-profile <<custom-ident>> { <<declaration-list>> }
2432+
@color-profile = @color-profile <<dashed-ident>> { <<declaration-list>> }
24292433
</pre>
24302434

2431-
The <<custom-ident>> gives the <a>color profile's</a> name.
2432-
All of the predefined colorspace keywords
2435+
The <<dashed-ident>> gives the <a>color profile's</a> name,
2436+
by which it will be used in a CSS stylesheet.
2437+
<!-- All of the predefined colorspace keywords
24332438
(''srgb'', ''display-p3'', ''a98-rgb'', ''prophoto-rgb'', ''rec2020'')
24342439
are excluded from this <<custom-ident>>,
2435-
as they're predefined by this specification and always available.
2440+
as they're predefined by this specification and always available. -->
24362441

24372442
The ''@color-profile'' rule accepts the descriptors defined in this specification.
24382443

0 commit comments

Comments
 (0)