Colore JS

Search documentation

Find a function or jump to a section.
v2.0.1

Colore compared

Colore can repair a low-contrast color, generate light and dark themes for shadcn/ui and Tailwind CSS v4, and update the theme file you already have. None of the five other libraries compared below can do any of those. Colore's coding-agent skill also gives your editor the same theme and contrast commands. Colore (colore-js on npm) is a separate project from Color.js (colorjs.io), which has a similar name.

Checked December 3, 2026.

✓ Supported · ◐ Partial support · — Unavailable

The grid covers built-in features. Each library can also mix colors in code.

Feature matrix

CapabilityColore v2Color.jsCuloriChroma.jstinycolor2colord
Read and write OKLCH CSS
Including wide-gamut colors
✓✓✓◐ Clips to sRGB—◐ Plugin, clips to sRGB
Read and write Display-P3 CSS✓✓✓———
Evaluate CSS color-mix()◐ Two colors, explicit space—————
Measure WCAG 2 contrast✓✓✓✓✓◐ a11y plugin
Measure APCA contrast✓✓—✓——
Adjust a color to meet a contrast target✓ ensureContrast()—————
Simulate color-vision deficiencies
Including achromatopsia
✓—◐ Protan, deutan, tritan———
Import selected functions or features✓ /fn✓ /fn✓ /fn✓ /light and deep imports—✓ Plugins
Generate a light and dark UI theme from one color✓ generateSystem()—————
Rebrand or extend an existing CSS theme file✓ applyThemeToCss()—————
Check and fix contrast from the command line✓ colore audit, fix—————
Skill for coding agents✓ npx colore-js init—————

Colore and Chroma.js

Chroma.js is built for data visualization: scales with domains and classes, bezier interpolation and the ColorBrewer palettes. It converts every color to sRGB when it parses it, so OKLCH colors outside sRGB change and Display P3 colors don't parse. Colore and chroma.js compared runs five common tasks in both.

Colore and tinycolor2

tinycolor2 is small and has been stable for years, but it can't read oklch() or color(), so Tailwind CSS v4 and current shadcn/ui colors come back invalid. Its lighten and darken work in HSL, so lighten(20) on violet-500 keeps only 40% of the chroma. Moving from tinycolor2 maps each method to Colore and shows where the results differ.

Colore and Culori

Culori covers many more color spaces and lets you register only the ones your app uses. Choose it for broad conversion work. It has no contrast repair or theme generation.

Colore and Color.js

Color.js converts across more spaces than Colore, such as Rec. 2020 and ProPhoto RGB, and lets you choose a chromatic adaptation method. Choose it for color science work across those spaces. It has no contrast repair or theme generation.

Colore and colord

colord has a very small core and adds features through plugins, including WCAG contrast, Lab, LCH and OKLCH. Its OKLCH plugin clips colors to sRGB, and it doesn't read Display P3. Choose it when bundle size matters most and your colors stay in sRGB.

Bundle size

LibraryGzip sizeSource
colord 2.14.12.3 kBCore package, plugins extra
tinycolor2 1.6.05.4 kBWhole package
Chroma.js 3.3.016.7 kBWhole package
Culori 4.0.222.2 kBWhole package
Color.js 0.7.132.4 kBWhole package
Colore 2.0.110 to 40 kBOne /fn function up to all root exports

The first five rows are bundlephobia's whole-package sizes, so they count everything even when your bundler would drop part of it. Colore's row is measured per import with Rollup and Terser. See performance and bundling for the full Colore table. Colore's upper figure includes contrast repair, auditing and theme generation, which none of the other five libraries has.

Library references

Colore API · Culori 4.0.2 · Chroma.js 3.3.0 · Color.js 0.7.1 · tinycolor2 1.6.0 · colord 2.14.1

Chroma.js OKLCH parsing source