v4.0.0
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], inoklab()/oklch()to[0, 1]at parse-time. - Correct numeric ranges in
hsl()andhwb()syntaxes from[0, 1]to[0, 100]. - Serialize missing components as
0in legacy syntaxes and asnonein modern syntaxes. - Use
0for missing components in all color space conversions and gamut mapping functions.
New features
- Adds the ICtCp color space, part of CSS Color HDR Module Level 1, with the name
itp; - Adds the ΔEITP color difference function as
differenceItp().
Fixes
- Make
averageAngle()always return in the[0, 360]interval; - Fix CIELUV (
luv) conversion forl = 0; - Allow CommonJS bare import
const culori = require('culori')(in addition to the previousculori/requireendpoint).