Skip to content

Commit 2de236d

Browse files
committed
[css-color] start conversion code for Rec.2020
1 parent c506a50 commit 2de236d

2 files changed

Lines changed: 209 additions & 156 deletions

File tree

css-color/Overview.bs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ These two colorspaces are indicated by using the predefined identifiers <i>P3</i
17151715
<i>Rec.2020</i> in the color function. No ''<@profile>'' at-rule is needed; if one is
17161716
supplied, it will be ignored.
17171717

1718-
The DCI P3[[P3]] colorspace has the following characteristics:
1718+
The DCI P3[[!P3]] colorspace has the following characteristics:
17191719

17201720
<table>
17211721
<tr><th>Red chromaticity</th><td>x=0.680 y=0.320</td></tr>
@@ -1725,7 +1725,7 @@ The DCI P3[[P3]] colorspace has the following characteristics:
17251725
<tr><th>Transfer function</th><td>1/2.6</td></tr>
17261726
</table>
17271727

1728-
The ITU Rec.2020[[2020]] colorspace has the following characteristics:
1728+
The ITU Rec.2020[[!2020]] colorspace has the following characteristics:
17291729

17301730
<table>
17311731
<tr><th>Red chromaticity</th><td>x=0.708 y=0.292</td></tr>
@@ -1735,15 +1735,13 @@ The ITU Rec.2020[[2020]] colorspace has the following characteristics:
17351735
<tr><th>Transfer function</th><td>see below</td></tr>
17361736
</table>
17371737

1738-
Rec.2020 defines two transfer functions, one for 10 bits per component
1739-
and one for 12 bits per component. Both use the same equation as sRGB, but with
1738+
Rec.2020 transfer function has the same form as the one for sRGB, but with
17401739
the constants at higher precision to cope with 10 or 12-bit components:
17411740

17421741
<pre> E < β ? 4.5 * E : α * Math.pow(E, 0.45) - (α - 1);
17431742
</pre>
17441743

1745-
For 10-bit, α=1.099 and β=0.018. For 12-bit, α=1.0993 and β=0.0181.
1746-
<!-- or give the full values, since this will be done in double precision float by JS anyway -->
1744+
Where α=1.09929682680944 and β=0.018053968510807 .
17471745

17481746
For both predefined color spaces, conversion to Lab requires several steps,
17491747
although in practice all but the first step are linear calculations and can be combined.</p>
@@ -1777,18 +1775,20 @@ are the same for colors inside the source and destination gamuts.
17771775
In a very similar way to the ''<@font-face.'' at-rule, the ''<@profile>'' at-rule has a descriptor
17781776
to give the profile a name which will be used inside the stylesheet,
17791777
<!-- is this actualy a descriptor, or a parameter to the at-rule?-->
1780-
1781-
and
1782-
another descriptor to point to the actual data ('src', just like 'src'' in font-face.)
1778+
and another descriptor to point to the actual data ('src', just like 'src'' in font-face.)
17831779
<!-- not clear how I link to the two different descriptors therte, in bikeshed syntax -->
17841780

17851781
<!-- should we add a format field to this descriptor, like with font-face src? it is always ICC format
17861782
in practice, but that could change in the future. or we could add format later, once there is
1787-
a need, ans make the default ICC if not specified -->
1783+
a need, and make the default ICC if not specified -->
17881784

17891785
In adition there is a third, optional descriptor to define the ''rendering intent'' to use.
17901786
This is only needed if the profile linked to has data for multiple rendering intents.
17911787

1788+
<pre class="prod">
1789+
<dfn at-rule
1790+
</pre>
1791+
17921792
<h2 id='cmyk-colors'>
17931793
Device-dependent CMYK Colors: the ''device-cmyk()'' function</h2>
17941794

0 commit comments

Comments
 (0)