Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Apr 18, 2024
1 parent ff782ab commit fcc1d7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions accepted/color-4-new-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,12 @@ one or more of its channels out of bounds, like `rgb(300 0 0)`).

#### `color.to-gamut()`

This function returns a color that is in the given gamut, using the current CSS
Color 4's `local-minde` algorithm to 'map' out-of-gamut colors into the desired
gamut with as little perceptual change as possible. In many cases this can be
more reliable for generating fallback values, rather than the 'channel clipping'
approach used by current browsers.
This function returns a color that is in the given gamut, using the given
mapping algorithm to convert out-of-gamut colors into the desired gamut with as
little perceptual change as possible. The current recommended algorithm is
`local-minde`, which is defined in the current candidate recommendation of CSS
Color 4, which can in many cases be more reliable for generating fallback values
than the "channel clipping" approach used by current browsers.

```scss
$green: oklch(0.8 2 150);
Expand Down
2 changes: 1 addition & 1 deletion js-api-doc/value/color.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export type HueInterpolationMethod =
* which a color can be clipped.
*
* [the original Color Level 4 candidate recommendation]: https://www.w3.org/TR/2024/CRD-css-color-4-20240213/#css-gamut-mapping
* [the original Color Level 4 candidate recommendation]: https://www.w3.org/TR/2024/CRD-css-color-4-20240213/#color-difference-OK
* [deltaEok]: https://www.w3.org/TR/2024/CRD-css-color-4-20240213/#color-difference-OK
* [local-MINDE]: https://www.w3.org/TR/2024/CRD-css-color-4-20240213/#GM-chroma-local-MINDE
*/
export type GamutMapMethod = 'clip' | 'local-minde';
Expand Down

0 comments on commit fcc1d7d

Please sign in to comment.