OSS Tanbou

convert and manipulate CSS Color 4 and other color spaces in JavaScript with gamut mapping, DeltaE, and interpolation

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
2,308
Primary language
JavaScript
License
MIT
Repository last updated
Sep 28, 2026
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]

Use 0.7.1 to avoid the 0.7.0 bundler accessor regression

v0.7.1 fixes a regression that broke space accessors such as color.oklch.l in bundlers, and the published npm package is version 0.7.1.

Sources: [2][3]

Official sources

  1. [1]Color.js v0.7.1 README(2026-10-03)
  2. [2]Color.js v0.7.1 release(2026-10-03)
  3. [3]colorjs.io 0.7.1 npm package(2026-10-03)
  4. [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. 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. 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. 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"))'
Check the official README

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

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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?