Color conversion & manipulation library by the editors of the CSS Color specifications.
Color.js is an open-source, high-precision JavaScript color manipulation and conversion library created by Lea Verou and Chris Lilley, co-editors of the W3C CSS Color specifications.
The main features and capabilities of Color.js include:
Color Space Agnostic Architecture: Represents colors independently of any single space, supporting a wide range of spaces including sRGB, HSL/HSV/HWB, Display P3, Lab/LCh, OKLab/OKLCh, Jzazbz, and REC.2100.
Full Color Science Rigor: Provides actual gamut mapping instead of naive clipping, multiple DeltaE color difference formulas (76, CMC, 2000, Jz), and several chromatic adaptation methods (von Kries, Bradford, CAT02, CAT16).
CSS Color Level 4 Compatibility: Fully up to date with CSS Color 4 specifications, offering input parsing and stringification for all CSS Color 4 formats.
Flexible & Object-Oriented API: Supports readable Color objects, chained coordinate manipulation, static functions, and relative property updates.
Modular, Tree-Shakeable & Dependency-Free: Operates in client-side browsers or Node.js with zero external dependencies, providing a procedural tree-shakeable API to keep bundle sizes small.
Color Interpolation & Range Operations: Offers built-in range generation, discrete stepping, and midpoint mixing across custom interpolation spaces.