On this page
Overview
Color.js is a color-conversion and manipulation library created by editors of the CSS Color specifications. It provides a common API across sRGB, Display P3, Lab/LCh, OKLab/OKLCh, REC.2100, and many other spaces together with gamut mapping, DeltaE, chromatic adaptation, and interpolation for browser and Node workflows.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Convert many color spaces through a shared object model
Color objects combine coordinates with a color-space reference and can convert among sRGB, Display P3, Lab/LCh, OKLab/OKLCh, REC.2100, and other supported spaces.
Sources: [1]
Use gamut mapping, DeltaE, and chromatic adaptation
The library goes beyond channel clipping with gamut mapping, several DeltaE formulas, and chromatic-adaptation methods such as Bradford and CAT16.
Sources: [1]
Choose object-oriented or tree-shakeable procedural APIs
A Color object API supports repeated manipulation, while procedural and per-module imports support performance-sensitive code and smaller bundles.
Sources: [1]
Best fit
Fits wide-gamut UI, color tools, and visualization
It is useful when frontend tools need to parse and convert CSS Color 4 formats, Display P3, OKLCH, and other advanced spaces regardless of native browser parsing support.
Sources: [1]
Before adoption
Carry color-space and gamut decisions through to output
Wide-gamut colors may fall outside sRGB. Select output space and gamut handling explicitly when serializing colors for target displays.
Sources: [1]
Select modules deliberately to control bundle size
Applications can import the full bundle or specific source modules. Frontend builds should keep only required spaces and color-difference functionality and verify tree-shaking output.
Sources: [1]
Official sources
- [1]Color.js v0.7.1 README(2026-10-03)
- [2]Color.js v0.7.1 release(2026-10-03)
- [3]colorjs.io 0.7.1 npm package(2026-10-03)
- [4]Color.js MIT license(2026-10-03)
Supplemental curator note
Color.js is useful when UI or visualization work needs more than basic hex conversion, especially for wide-gamut and perceptual color spaces. Define the target display gamut and output space across the color pipeline to avoid accidental clipping.
Try it in 3 steps
- 1
Install Color.js 0.7.1
Pin the published npm package to version 0.7.1.
npm install colorjs.io@0.7.1 - 2
Convert OKLCH to sRGB
Parse a CSS Color value, convert it to another color space, and serialize the result.
node --input-type=module -e 'import Color from "colorjs.io"; const c=new Color("oklch(60% 0.2 30)"); console.log(c.to("srgb").toString())' - 3
Calculate color difference against Display P3
Compute DeltaE between two colors including a wide-gamut Display P3 value.
node --input-type=module -e 'import Color from "colorjs.io"; const a=new Color("red"); const b=new Color("color(display-p3 1 0 0)"); console.log(a.deltaE(b,"2000"))'
Growth
Growth trends · Last 30 days
2,308 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 5
- Open PRs
- 13
Development activity is still being collected.
Built with
Categories and tags
Categories
Tags
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- cielab
- color
- color-palette
- color-spaces
- esm
- oklab
- oklch
- rec2020
- srgb
- display-p3
- interpolation
- Stars
- 2,308
- Forks
- 100
- Watchers
- 18
- Open issues
- 81
- Contributors
- 51
- Owner type
- Organization
- Primary language
- JavaScript
- License
- MIT
- Repository last updated
- Sep 28, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Carbon Design System9,517 Stars
3 shared tag(s) · 1 shared category(s) · Same language
share React components, Sass styles, design tokens, and icons to build product interfaces aligned with IBM Design Language
JavaScript - Bootstrap174,984 Stars
3 shared tag(s) · 1 shared category(s)
Build responsive interfaces from a CSS/Sass grid, utilities, components, and native JavaScript
MDX - React250,863 Stars
2 shared tag(s) · 1 shared category(s) · Same language
build web and native interfaces from declarative components
JavaScript - Svelte88,230 Stars
2 shared tag(s) · 1 shared category(s) · Same language
compile components into efficient JavaScript and express reactive UI through runes
JavaScript - Prettier52,314 Stars
2 shared tag(s) · 1 shared category(s) · Same language
an opinionated formatter that parses code and reprints a consistent style
JavaScript - GSAP28,779 Stars
2 shared tag(s) · 1 shared category(s) · Same language
control advanced web animation with tweens, timelines, scroll triggers, and plugins
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.