unstale

npm / chroma-js

chroma-js

What changed in chroma-js 2 to 3, from its official release notes, upgrade guides and advisories. Also covers @types/chroma-js. Sources checked 2026-10-29.

8 breaking5 new APIs and options3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

chroma-js 39 changes

Breaking changes 3

  • The domain function now returns all scaled positions rather than only the minimum and maximum.

    3.2.0release notes

  • color.css() now returns modern space-separated CSS colors instead of legacy comma-separated syntax.

    3.0.0release notes

  • The hsl2rgb conversion no longer rounds.

    3.0.0release notes

New APIs and options 3

  • chroma.random accepts an rng argument, allowing callers to provide a random number generator.

    3.1.4release notes

  • CSS colors can now be exported and parsed in lab(), lch(), oklab(), and oklch() color spaces.

    3.0.0release notes

  • Sets the standard white reference point for the CIE Lab and CIE Lch color spaces.

    3.0.0release notes

Fixes and other changes 3

chroma-js 27 changes

Breaking changes 5

  • The default interpolation for average is now lrgb.

    2.0.0release notes

  • When colors cannot be parsed correctly, chroma now throws Errors instead of silently failing with console.errors.

    2.0.0release notes

  • HCG inputs now use [0..360,0..1,0..1] instead of [0..360,0..100,0..100], aligning with HSL.

    2.0.0release notes

  • The default interpolation for interpolate is now lrgb.

    2.0.0release notes

  • The default interpolation for mix is now lrgb.

    2.0.0release notes

New APIs and options 2

  • chroma.js was ported to ES6, allowing projects to import parts of chroma.

    2.0.0release notes

  • Color conversion functions support object unpacking, such as passing {h,s,l} to hsl2rgb.

    2.0.0release notes