diff --git a/css-color-4/Overview.bs b/css-color-4/Overview.bs index b8757467da33..34261b7de22d 100644 --- a/css-color-4/Overview.bs +++ b/css-color-4/Overview.bs @@ -6052,9 +6052,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping
    -
  1. if |origin| is in gamut for |destination|, - convert |origin| to |destination| and return it as the gamut mapped color -
  2. +
  3. 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
  4. let |origin_OkLCh| be |origin| converted from |origin color space| to the OkLCh color space
  5. @@ -6071,45 +6069,51 @@ Sample Pseudocode for the Ray Trace Gamut Mapping
  6. let |origin_rgb| be |origin_OkLCh| converted to the linear-light form of |destination|
  7. -
  8. let |low| be 1E-6 1
  9. -
  10. let |high| be 1.0 - |low| 2
  11. -
  12. let |last| be |origin_rgb|
  13. -
  14. for (i=0; i<4; i++) + +
  15. if |origin_rgb| is not in gamut
  16. - -
  17. let |clipped| be |origin_rgb| clipped to gamut (components in range 0 to 1), - thus trimming off any noise due to floating point inaccuracy -
  18. -
  19. return |clipped|, converted to |destination| as the gamut mapped color
  20. - + +
  21. let clip(|color|) be a function which converts |color| to |destination|, + clamps each component to the bounds of the reference range for that component + and returns the result
  22. +
  23. set |clipped| to clip(|current|)
  24. +
  25. return |clipped| as the gamut mapped color
@@ -6135,7 +6139,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping
  • let |d| be |b| - |a|
  • let |direction|[i] be |d|
  • -
  • if (d != 0): +
  • if abs(|d|) < 1E-12
  • -
  • if (|tnear| > 10) +
  • if |tnear| is infinite (or matches the initial very large value)