Skip to content

Commit 7ad039f

Browse files
committed
[css-color-5] Add missing color swatches, #7692
1 parent 5e30654 commit 7ad039f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

css-color-5/Overview.bs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1928,27 +1928,25 @@ or any other color or monochrome output device which has been characterized.
19281928
<pre class="lang-css">
19291929
@media (color-gamut: srgb) {
19301930
.header {
1931-
background-color: rgb(8.154% 60.9704% 37.184%);
1931+
background-color: <span class="swatch" style="--color: rgb(8.154% 60.9704% 37.184%)"></span>&nbsp;rgb(8.154% 60.9704% 37.184%);
19321932
}
19331933
}
19341934
@media print, (color-gamut: p3){
19351935
.header {
1936-
background-color: color(--fogra39 90% 0% 90% 0%);
1936+
background-color: <span class="swatch oog" style="--color: rgb(0% 62.06% 34%)"></span>&nbsp;color(--fogra39 90% 0% 90% 0%);
19371937
}
19381938
}
19391939
</pre>
19401940

1941-
Note: This example does not use illustrative swatches, because most of the colors are outside of sRGB.
1942-
19431941
This CMYK color corresponds to lab(56.596645% -58.995875 28.072154)
19441942
or lch(56.596645% 65.33421077211648 154.5533771086801).
19451943
In sRGB this would be rgb(-60.568% 62.558% 32.390%) which,
19461944
as the large negative red component shows,
19471945
is out of gamut.
19481946

19491947
Reducing the chroma until the result is in gamut
1950-
gives lch(56.596645% 51 154.5533771086801)
1951-
which is rgb(8.154% 60.9704% 37.184%)
1948+
gives <span class="swatch" style="--color: rgb(8.154% 60.9704% 37.184%)"></span>&nbsp;lch(56.596645% 51 154.5533771086801)
1949+
which is <span class="swatch" style="--color: rgb(8.154% 60.9704% 37.184%)"></span>&nbsp;rgb(8.154% 60.9704% 37.184%)
19521950
and this has been manually specified as a fallback color.
19531951

19541952
For wide gamut screens, the color is inside the display-p3 gamut

0 commit comments

Comments
 (0)