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
Copy file name to clipboardExpand all lines: css-color-4/Overview.bs
+39-35Lines changed: 39 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -6072,9 +6072,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping</h4>
6072
6072
6073
6073
<ol>
6074
6074
<!-- check if we need gamut mapping at all -->
6075
-
<li>if |origin| is in gamut for |destination|,
6076
-
convert |origin| to |destination| and return it as the gamut mapped color
6077
-
</li>
6075
+
<li>if |destination| has no gamut limits (XYZ-D65, XYZ-D50, Lab, LCH, Oklab, OkLCh) convert |origin| to |destination| and return it as the gamut mapped color
6078
6076
<!-- we do, so convert to OkLCh -->
6079
6077
<li>let |origin_OkLCh| be |origin| converted from |origin color space|
6080
6078
to the OkLCh color space</li>
@@ -6091,45 +6089,51 @@ Sample Pseudocode for the Ray Trace Gamut Mapping</h4>
6091
6089
</li>
6092
6090
<li>let |origin_rgb| be |origin_OkLCh|
6093
6091
converted to the <em>linear-light</em> form of |destination|</li>
6094
-
<li>let |low| be 1E-6 <a href="#raytrace-footnote-1"><sup>1</sup></a></li>
6095
-
<li>let |high| be 1.0 - |low| <a href="#raytrace-footnote-2"><sup>2</sup></a></li>
6096
-
<li>let |last| be |origin_rgb|</li>
6097
-
<li>for (i=0; i<4; i++)
6092
+
<!-- check if we need gamut mapping at all -->
6093
+
<li>if |origin_rgb| is not in gamut
6098
6094
<ul>
6099
-
<li>if (i > 0)
6095
+
<!-- we do, so perform chroma reduction -->
6096
+
<li>let |low| be 0.0 + 1E-6 <a href="#raytrace-footnote-1"><sup>1</sup></a></li>
6097
+
<li>let |high| be 1.0 - 1E-6 <a href="#raytrace-footnote-2"><sup>2</sup></a></li>
6098
+
<li>let |last| be |origin_rgb|</li>
6099
+
<li>for (i=0; i<4; i++)
6100
6100
<ul>
6101
-
<li>let |current_OkLCh| be |origin_rgb| converted to OkLCh</li>
6102
-
<li>let the lightness of |current_OkLCh| be |l_origin|</li>
0 commit comments