You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -890,7 +889,7 @@ Converting JzCzHz colors to Jzazbz colors</h4>
890
889
the Hunt-Pointer-Estevez (HPE) XYZ to LMS transform
891
890
is used,
892
891
normalized to a [=D65=] whitepoint.
893
-
A crosstalk matrix is then applied,
892
+
A 4% crosstalk matrix is then applied[[What_is_ICtCp]],
894
893
to reduce the gamut hull concavities of BT.2020 RGB,
895
894
thus reducing interpolation errors.
896
895
The crosstalk also provides improved lines of constant hue
@@ -921,11 +920,12 @@ Converting JzCzHz colors to Jzazbz colors</h4>
921
920
by a conversion from linear-light BT.2100 RGB [[Rec_BT.2100]],
922
921
this conversion proceeds via LMS
923
922
and thus, any other color space can also be represented
924
-
by applying an XYZ to LMS transform.
923
+
by applying an XYZ to LMS transform
924
+
as shown in [[What_is_ICtCp]].
925
925
926
-
Note that unlike Lab, a [=D65=] whitepoint is used.
926
+
Note that unlike CIE ''Lab'', a [=D65=] whitepoint is used.
927
927
928
-
Also unlike Lab, which has primarily been tested with
928
+
Also unlike ''Lab'', which has primarily been tested with
929
929
lower-intensity reflective colors,
930
930
IC<sub>T</sub>C<sub>P</sub> has been tested with
931
931
high-chroma,
@@ -1034,6 +1034,29 @@ Serializing values of the ''color()'' function</h3>
1034
1034
is recommended for internal storage).
1035
1035
Values must be <a href="https://drafts.csswg.org/css-values-4/#combine-integers">rounded towards +∞</a>, not truncated.
1036
1036
1037
+
<!--
1038
+
██████ ███████ ████████ ████████
1039
+
██ ██ ██ ██ ██ ██ ██
1040
+
██ ██ ██ ██ ██ ██
1041
+
██ ██ ██ ██ ██ ██████
1042
+
██ ██ ██ ██ ██ ██
1043
+
██ ██ ██ ██ ██ ██ ██
1044
+
██████ ███████ ████████ ████████
1045
+
-->
1046
+
1047
+
<h2 id="color-conversion-code">
1048
+
Sample code for Color Conversions</h2>
1049
+
1050
+
<em>This section is not normative.</em>
1051
+
<wpt title="This section is not normative, it does not need tests."></wpt>
1052
+
1053
+
1054
+
For clarity, <a href="https://drafts.csswg.org/css-color-4/multiply-matrices.js">a library</a> is used for matrix multiplication.
1055
+
(This is more readable than inlining all the multiplies and adds).
1056
+
The matrices are in <a href="https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/geometry/row-major-vs-column-major-vector">column-major order</a>.
1057
+
1058
+
This code also assumes all of the conversion code from
1059
+
[[css-color-4#color-conversion-code]] is available.
0 commit comments