Skip to content

v4.0.0

Compare
Choose a tag to compare
@danburzo danburzo released this 19 Jan 17:10
· 18 commits to main since this release

Breaking changes

This release includes changes to how color strings are parsed, converted, and serialized, for better alignment to CSS specs:

  • Clamp alpha to the [0, 1] interval at parse-time.
  • Clamp L in lab() / lch() to [0, 100], in oklab() / oklch() to [0, 1] at parse-time.
  • Correct numeric ranges in hsl() and hwb() syntaxes from [0, 1] to [0, 100].
  • Serialize missing components as 0 in legacy syntaxes and as none in modern syntaxes.
  • Use 0 for missing components in all color space conversions and gamut mapping functions.

New features

Fixes

  • Make averageAngle() always return in the [0, 360] interval;
  • Fix CIELUV (luv) conversion for l = 0;
  • Allow CommonJS bare import const culori = require('culori') (in addition to the previous culori/require endpoint).