@@ -3094,7 +3094,6 @@ Profiled, Device-dependent Colors</h2>
3094
3094
In each case, the numerical parameters
3095
3095
are in the range 0.0 to 1.0
3096
3096
(rather than, for example, 0 to 255).
3097
- <!-- add examples with alpha, and with fallback -->
3098
3097
<pre class="lang-css">
3099
3098
color: color(--swopc 0.0134 0.8078 0.7451 0.3019);
3100
3099
color: color(--indigo 0.0941 0.6274 0.3372 0.1647 0 0.0706 0.1216);
@@ -3124,19 +3123,17 @@ Profiled, Device-dependent Colors</h2>
3124
3123
Its syntax is:
3125
3124
3126
3125
<pre class='prod'>
3127
- <dfn>color()</dfn> = color( [ [ <<ident>> | <<dashed-ident>> ] [ <<number-percentage>> + ] [ / <<alpha-value>> ]? ]# , <<color>> ? )
3126
+ <dfn>color()</dfn> = color( [<<ident>> | <<dashed-ident>> ] [ <<number-percentage>> + ] [ / <<alpha-value>> ]? )
3128
3127
</pre>
3129
3128
3129
+ <!-- check this test, remove any fallback testing -->
3130
3130
<wpt>
3131
3131
color-function-parsing.html
3132
3132
</wpt>
3133
3133
3134
- The color function takes one or more comma-separated arguments,
3135
- with each argument specifying a color,
3136
- and later colors acting as "fallback" if an earlier color [=can't be displayed=]
3137
- (for example, if the colorspace it specifies hasn't been loaded yet).
3134
+ The color function takes parameters specifying a color, in an explicitly listed colorspace.
3138
3135
3139
- Each argument represents either an <dfn export>invalid color</dfn> , as described below,
3136
+ It represents either an <dfn export>invalid color</dfn> , as described below,
3140
3137
or a [=valid color=] .
3141
3138
3142
3139
Any color which is not an [=invalid color=] is a <dfn export>valid color</dfn> .
@@ -3158,7 +3155,7 @@ Profiled, Device-dependent Colors</h2>
3158
3155
Each [=valid color=] is either in-gamut for the output device (screen, or printer),
3159
3156
or it is [=out of gamut=] .
3160
3157
3161
- Each argument has the following form:
3158
+ The parameters have the following form:
3162
3159
3163
3160
* An <<ident>> or <<dashed-ident>> denoting the colorspace.
3164
3161
If this is an <<ident>> it denotes one of the <a href="#predefined">predefined colorspaces</a>
@@ -3218,40 +3215,31 @@ Profiled, Device-dependent Colors</h2>
3218
3215
This is interpreted the same way as the <<alpha-value>> in ''rgb()'' ,
3219
3216
and if omitted it defaults to ''100%'' .
3220
3217
3221
- After one or more arguments of the above form,
3222
- a final <<color>> argument
3223
- using any CSS color syntax
3224
- can be provided.
3225
3218
3219
+ <!--
3220
+ remove this from wpt
3226
3221
<wpt>
3227
3222
predefined-015.html
3228
- </wpt>
3223
+ </wpt> -->
3229
3224
3230
- This final argument can again be either a [=valid color=]
3231
- or an [=invalid color=] ; and if valid it can be either
3232
- in-gamut for the output device, or [=out of gamut=] .
3233
3225
3234
3226
A color which is either an [=invalid color=] or
3235
3227
an [=out of gamut=] color
3236
3228
<dfn export>can't be displayed</dfn> .
3237
3229
3238
- The first choice for the value of the ''color()'' function
3239
- is that it represents the color
3240
- specified by the first of its arguments that
3241
- <dfn export>can be displayed</dfn> ,
3242
- (that is, the first argument that isn't an [=invalid color=]
3243
- and isn't [=out of gamut=] ).
3244
-
3245
- If all of its arguments [=can't be displayed=] ],
3246
- second choice for the value of the ''color()'' function
3247
- is that it represents the color
3248
- specified by the first of its arguments that represent
3249
- a [=valid color=] , which will then be
3230
+ If the specified color <dfn export>can be displayed</dfn> ,
3231
+ (that is, it isn't an [=invalid color=]
3232
+ and isn't [=out of gamut=] )
3233
+ then this is the used value of the ''color()'' function.
3234
+
3235
+ If the specified color
3236
+ is a [=valid color=]
3237
+ but [=can't be displayed=] ],
3238
+ the used value is derived from the specified color,
3250
3239
<a>gamut-mapped</a> for display.
3251
3240
3252
- If all of its arguments are [=invalid color=] s,
3253
- the third choice for the value of the ''color()'' function
3254
- is that it represents <a>opaque black</a> .
3241
+ If the color is an [=invalid color=] ,
3242
+ the used value is <a>opaque black</a> .
3255
3243
3256
3244
3257
3245
<div class="example" id="ex-2020-oog-p3">
@@ -3274,34 +3262,11 @@ Profiled, Device-dependent Colors</h2>
3274
3262
produced automatically by gamut mapping.
3275
3263
</div>
3276
3264
3277
- <div class="example" id="ex-2020-fallback">
3278
- The same color as the previous example is now specified with a fallback
3279
- <pre class="lang-css"> color(rec2020 0.42053 0.979780 0.00579, color(display-p3(0 1 0)));</pre>
3280
- On a display-p3 screen,
3281
- because the first-choice color can't be displayed
3282
- and because a fallback has been given which is in-gamut for the display,
3283
- the fallback color will be used.
3284
- </div>
3285
-
3286
- <div class="example" id="ex-prophoto-two-fallbacks">
3287
- An intense green is provided in prophoto-rgb space.
3288
- It has a first fallback, which is the same color in display-p3
3289
- in case prophoto is unsupported. The color is in gamut of display-p3.
3290
- Lastly, a desaturated sRGB fallback is provided
3291
- (desaturated, as the original color is outside the sRGB gamut).
3292
- <pre class="lang-css"> color(prophoto-rgb 0.4835 0.9167 0.2188, color(display-p3 0.3499 0.9800 0.1399, rgb(33.44% 96.68% 21.07%)))</pre>
3293
- </div>
3294
-
3295
3265
<div class="invalid example" id="ex-profoto-bad">
3296
- Same as the previous example, but with a typo!
3266
+ This example has a typo!
3297
3267
An intense green is provided in profoto-rgb space (which doesn't exist).
3298
- Ths makes it invalid, so we go to the first fallback, which is the same color in display-p3.
3299
- The color is in gamut of display-p3.
3300
- Lastly, a desaturated sRGB fallback is provided.
3301
- If the output device is limited to sRGB gamut,
3302
- the display-p3 value will be <em> out of output gamut</em>
3303
- so the desaturated, sRGB value is used.
3304
- <pre class="lang-css"> color(profoto-rgb 0.4835 0.9167 0.2188, color(display-p3 0.3499 0.9800 0.1399, rgb(33.44% 96.68% 21.07%)))</pre>
3268
+ This makes it invalid, so the used value is <a>opaque black</a>
3269
+ <pre class="lang-css"> color(profoto-rgb 0.4835 0.9167 0.2188)</pre>
3305
3270
</div>
3306
3271
3307
3272
<h3 id="predefined">
@@ -3995,14 +3960,17 @@ can proceed as normal.
3995
3960
</div>
3996
3961
3997
3962
Fallback colors can be specified,
3998
- for example if the specified CMYK color is known
3963
+ for example using media queries,
3964
+ to be used
3965
+ if the specified CMYK color is known
3999
3966
to be outside the sRGB gamut.
4000
3967
4001
3968
<div class="example" id="ex-fogra39-fallback-mq">
4002
3969
This example uses the same FOGRA39 setup as before,
4003
3970
but specifies a bright green which is outside the sRGB gamut.
4004
3971
It is, however, inside the display-p3 gamut.
4005
3972
Therefore it is displayed as-is on wide gamut screens
3973
+ and in print,
4006
3974
and a less intense fallback color is used on sRGB screens.
4007
3975
4008
3976
<!--
@@ -4016,7 +3984,7 @@ to be outside the sRGB gamut.
4016
3984
<pre class="lang-css">
4017
3985
@media (color-gamut: srgb) {
4018
3986
.header {
4019
- background-color: color(--fogra39 90% 0% 90% 0%, <span class="swatch" style="--color: rgb(8.154% 60.9704% 37.184%)"></span> rgb(8.154% 60.9704% 37.184%) );
3987
+ background-color: rgb(8.154% 60.9704% 37.184%);
4020
3988
}
4021
3989
}
4022
3990
@media print, (color-gamut: p3){
@@ -4037,11 +4005,10 @@ to be outside the sRGB gamut.
4037
4005
Reducing the chroma until the result is in gamut
4038
4006
gives lch(56.596645% 51 154.5533771086801)
4039
4007
which is rgb(8.154% 60.9704% 37.184%)
4040
- and this is used as the fallback color.
4008
+ and this has been manually specified as a fallback color.
4041
4009
4042
4010
For wide gamut screens, the color is inside the display-p3 gamut
4043
- so no fallback need be specified.
4044
- However, for the curious, the color is display-p3(0.1658 0.6147 0.3533).
4011
+ (it is display-p3(0.1658 0.6147 0.3533) ).
4045
4012
4046
4013
<!--
4047
4014
grn=[56.596645, -58.995875, 28.072154 ]
0 commit comments