Skip to content

v0.19.0

Compare
Choose a tag to compare
@danburzo danburzo released this 26 Jul 09:29
· 153 commits to main since this release

⚠️ Breaking changes

culori.clampChroma() now accepts a second argument mode to control on which color space the chroma-finding algorithm operates (re: #129). This is a potentially breaking change if you were using culori.clampChroma as a callback to array methods:

['red', 'green'].map(culori.clampChroma);

The function's freshly introduced second parameter (mode) vs. the second argument to array method callbacks (index) means this usage will break in culori@0.19.0. Update it to:

['red', 'green'].map(color => culori.clampChroma(color));

New features

  • culori.differenceHyab() — A hybrid Euclidean-city-block-distance formula shown to work better for large color differences than CIEDE2000, while still holding up well for smaller color differences. (#126)
  • culori.formatHsl() — Returns the hsl(…) / hsla(…) string for a color, with values rounded to a precision of two digits. (#124)

Bug fixes

  • culori.clampChroma() always returns a displayable color, rather than a color in the near vicinity of a displayable color (#129);
  • Return undefined on culori.parse(undefined) rather than throwing an error;
  • Use updated matrices for Oklab;
  • Fix transfer functions for negative values in RGB color spaces.

Miscellaneous

  • (docs) Clarified that the sRGB gamut spans a Lightness of approximatively [0, 0.999] in oklab / oklch. (The value l: 1 is not displayable in rgb.)
  • (repo) renamed the default branch to main