# color-space vs culori vs colorjs.io vs chroma-js vs @texel/color

A factual comparison of JavaScript color conversion libraries. Each library has a distinct scope; this document maps where they overlap and where they differ so you can pick the right tool.

---

## Summary table

| | color-space | culori | colorjs.io | chroma-js | @texel/color |
|---|---|---|---|---|---|
| **Version compared** | 3.4 | 4.0.2 | 0.7.1 | 3.2.0 | 1.1.11 |
| **Color spaces** | **221** | 30 | 51 | 11 | 16 |
| **API value ranges** | Conventional per space | Mixed; RGB normalized | Mixed; RGB normalized | Mixed / CSS strings | Mostly normalized |
| **CSS string parsing** | Yes (`color-space/util`) | Yes | Yes | Yes (but `hwb()`, `color()`) | Yes (hex, `rgb()`, `oklab()`, `oklch()`, `color()`) |
| **Color mixing / interpolation** | Yes (`util.mix`) | Yes | Yes | Yes | No |
| **Gamut mapping** | No (`util.gamut` names the gamut, maps nothing) | Yes | Yes | No | Yes (OKLCH, Ottosson) |
| **Delta-E (color difference)** | Yes (CIEDE2000, ΔEOK) | Yes | Yes | Yes | Yes (ΔEOK) |
| **WCAG contrast** | Yes | Yes | Yes | Yes | No |
| **Palette generation** | No | No | No | Yes | No |
| **Tree-shakeable ESM** | Yes | Yes | Yes | No | Yes |
| **Zero dependencies** | Yes | Yes | Yes | Yes | Yes |
| **Differential-tested vs colorjs.io** | 29 spaces, both directions | — | — | — | — |
| **Bundle (full, min+gz)** | 70 kB¹ | 23 kB | 34 kB | 17 kB | 9 kB |
| **Batch / typed-array API** | Yes (JS + WASM) | No | No | No | No (per-color `convert` into a reused `output`) |
| **Scalar speed, M op/s²** | 5.81 | 4.31 | 0.15 (0.5.2) | 1.17 (6 of 7) | 3.53 (3 of 7) |

Full-library min+gz, every library bundled the same way: esbuild 0.28, minified, gzip -9, 2026-10-18 (culori 4.0.2, colorjs.io 0.7.1, chroma-js 3.2.0, @texel/color 1.1.11). ¹color-space's 70 kB is **all 221 spaces** — larger than the others because it has 4–20× more spaces. But it is tree-shakeable: a single space is **about 1 kB** (median 0.96 kB; `import oklch from 'color-space/oklch.js'` → 1.4 kB; Munsell's tables 15 kB), the figure that matters in practice. culori and colorjs.io are also tree-shakeable — compare like-for-like (single import vs single import), not a single import against a full bundle. ²Geometric mean over the 7 shared `npm run benchmark` conversions (rgb ⇄ lab · hsl · oklab, rgb → p3), each library over the subset it implements — color-space on chroma-js's 6 is 6.75, on texel's 3 is 3.78; median of 3 runs, 2026-10-18, Node 22.22 / Apple M4 Max, timed by process CPU time; culori 4.0.2, colorjs.io 0.5.2 (the bundle row is 0.7.1's), chroma-js 3.2.0, @texel/color 1.1.11; method in [benchmark/](../benchmark/). Absolute figures move with the machine; compare ratios.

---

## Value ranges — the most consequential API difference

The compared libraries do not share one range convention. culori, colorjs.io, and @texel/color normalize RGB to 0–1, but perceptual lightness and hue conventions vary by space and library. color-space deliberately keeps each space's familiar literature or CSS range:

```js
// color-space
lab.rgb(50, 0, 0)            // L: 0–100, a/b: –125 to +125
oklch.rgb(0.65, 0.25, 180)   // L: 0–1, C: 0–0.4, H: 0–360° — as CSS oklch(0.65 0.25 180)
hsl.rgb(180, 75, 50)    // H: 0–360°, S/L: 0–100%
rgb.hsl(255, 128, 0)    // R/G/B: 0–255
```

Normalized RGB is convenient for GPU and compositing work; conventional per-space ranges are self-documenting and often match standards or CSS coordinates directly. Neither choice is universally right, so callers should consult each library's range metadata rather than assume every channel is 0–1.

---

## Color space coverage

### Spaces all libraries share (or most do)

sRGB, linear sRGB, HSL, HSV, HWB, Lab (CIE 1976), LCH, OKLab, OKLCH, XYZ D65, Display P3, Rec. 2020, A98 RGB, ProPhoto RGB, HWB.

### Spaces color-space covers that others do not

**Video and broadcast** — YUV, YIQ, YCbCr (BT.601), YcCbcCrc (BT.2020 constant-luminance), YPbPr, YDbDr, YCgCo, JPEG full-range YCbCr, xvYCC. None of culori, colorjs.io, chroma-js, or @texel/color include these.

**Film / professional** — ACEScg/cc/cct, ACES2065-1, plus the camera log encodings: ARRI LogC3/LogC4, Sony S-Log2/S-Log3, Panasonic V-Log, RED Log3G10, Canon Log/Log2/Log3, Fujifilm F-Log/F-Log2/F-Log2 C, Nikon N-Log, Apple Log/Apple Log 2, Blackmagic Film Gen5, DJI D-Log, GoPro GP-Log2, Kinefinity KineLOG3, Samsung Log, Insta360 I-Log, Cineon. culori and colorjs.io include ACEScc/cg, but **none** of the compared libraries include the camera log curves — this is color-space's clearest moat.

**HDR** — Jzazbz, JzCzHz, ICtCp, Rec. 2100 PQ, Rec. 2100 HLG. colorjs.io covers most of these; culori covers Jzazbz/JzCzHz and ICtCp; @texel/color and chroma-js largely do not.

**Color appearance** — CAM16, CIECAM02, CAM16-UCS, CAM02-UCS, CAM02/16-LCD & SCD, Hellwig 2022, ZCAM, and HCT (Google Material). colorjs.io has CAM16-JMh; the rest are rarely found in JS libraries.

**Historical CIE** — CIE 1960 UCS, CIE 1964 UVW, Hunter Lab. colorjs.io includes some; culori, chroma-js, and @texel/color do not.

**Cross-disciplinary specialty** — Coloroid (architectural color system, MSZ 7300), TSL (face detection), YES (face recognition), RG chromaticity (illumination-invariant vision), HSI, HCY, HSP, HCG, HCL, HSM, OSA-UCS. These are absent from all other compared libraries.

**LUV family** — LUV, LCHuv, HSLuv, HPLuv. culori and colorjs.io include LUV/LCHuv, colorjs.io alone HSLuv/HPLuv; @texel/color and chroma-js largely do not cover LUV/LCHuv.

---

## What the other libraries do better

**culori** is the most capable all-around color toolkit for web and design work. It has CSS string parsing, color interpolation (with gamut-mapping modes for CSS `color-mix()` and CSS gradients), deltaE (2000, CMC, ITP), WCAG contrast, and a well-tested API. Its 0–1 normalization is intentional and makes interpolation math uniform across spaces. If you are building a CSS-adjacent tool or a design system, culori is the mature choice.

**colorjs.io** is the reference implementation for the W3C CSS Color specification, co-authored by the spec editors. It is the closest thing to a ground truth for CSS color behavior and is authoritative for specification questions. Its coverage of modern perceptual spaces (OKLab, OKLCH, HDR) is thorough, and it includes relative-color and gamut-mapping features that track the evolving spec. If you need CSS Color 4/5 fidelity or are implementing a browser-level feature, colorjs.io is the right starting point.

**chroma-js** is the most ergonomic library for palette and visualization work. It includes Brewer color scales, palette generation, and a fluent API that makes common tasks (brighten, darken, mix, scale) one-liners. For data visualization tooling or quick color palette code, chroma-js is the most productive library of this group.

**@texel/color** is designed for WebGL and GPU workflows where data stays normalized 0–1, and it has the smallest bundle. On the conversions it implements it runs even with color-space (3.53 M op/s over rgb ⇄ oklab and rgb → p3, color-space 3.78 on the same², within the spread of the runs: color-space leads on oklab → rgb, the other two trade places run to run); over a 1M-pixel rgb → oklab buffer its per-pixel loop runs ahead of color-space's JS batch API (4.22 vs 3.54 M px/s, medians of 3 runs the same day), and color-space's WASM kernel runs 12.12 M px/s there, 2.87× texel. It is the correct choice when 0–1 data and a minimal bundle matter more than space coverage.

---

## Verification

color-space v3 includes a differential test suite (`test/reference.js`) that validates 29 spaces against colorjs.io in both directions through sRGB. This catches self-cancelling round-trip bugs (a forward and inverse error that cancel each other in A→B→A tests). The tolerance is 1/255 (sub-perceptual). Spaces covered: srgb-linear, display-p3 (+ linear), rec2020 (+ linear), a98rgb (+ linear), prophoto (+ linear), xyz-d65, xyz-d50, lab (D50), LUV, LCHuv, OKLab, OKLCH, HSL, HSV, HWB, Jzazbz, JzCzHz, ICtCp, ACEScg, ACEScc, CAM16, Rec. 2100 PQ/HLG.

Separately, 212 spaces carry at least one cited input→output value from their defining document or a named reference implementation (341 rows, the spaces above that every library shares among them), published as [`conformance.json`](https://color-space.io/conformance.json) for any library's own tests; [conformance.md](conformance.md) says how to run it. Camera logs with an official Academy transform are also checked against the ACES CTLs ([formula-verification.md](formula-verification.md#camera-log-verification-against-official-aces-transforms)).

---

## Choose X if…

**color-space** — you need conversion formulas across a broad or unusual range of spaces (video, film, appearance, historical, research) and want to build your own pipeline on top. `color-space/util` adds parsing, mixing, ΔE and contrast; gamut mapping is not included.

**culori** — you are building CSS-adjacent tooling, color pickers, design system utilities, or gradient engines. You want interpolation, gamut mapping, and delta-E included, with a normalized API that works uniformly across spaces.

**colorjs.io** — you need the authoritative implementation of CSS Color 4/5, are implementing spec behavior, or are doing W3C-level work. Also a good choice when relative-color, gamut-mapping modes, or deltaE 2000 fidelity are required.

**chroma-js** — you are doing data visualization, need palette generation or Brewer scales, or want a fluent API where `chroma('red').brighten(2).hex()` is the right level of abstraction.

**@texel/color** — you are processing pixel buffers in WebGL, compute shaders, or tight JS loops over typed arrays. 0–1 normalization and a minimal bundle matter more than space breadth.

---

## What color-space is not

color-space is a conversion kernel, not a color toolkit. `color-space/util` carries only the tools the atlas itself uses: CSS parsing and formatting, mixing, the tightest display gamut, visibility, ΔE (CIEDE2000, ΔEOK), WCAG contrast and color-vision simulation. It deliberately omits:

- Gamut mapping (`util.gamut` names the gamut a color fits; it moves nothing)
- Palette and scale generation
- Color objects, alpha handling, a fluent API

These belong to the application layer. culori, colorjs.io, and chroma-js implement them well and could use color-space as a conversion substrate.

---

## Libraries

- **culori** — <https://culorijs.org> · [github.com/Evercoder/culori](https://github.com/Evercoder/culori)
- **colorjs.io** — <https://colorjs.io> · [github.com/color-js/color.js](https://github.com/color-js/color.js)
- **chroma-js** — <https://gka.github.io/chroma.js/> · [github.com/gka/chroma.js](https://github.com/gka/chroma.js)
- **@texel/color** — [github.com/texel-org/color](https://github.com/texel-org/color)
- **d3-color** — [github.com/d3/d3-color](https://github.com/d3/d3-color)
- **CSS Color 4** — <https://www.w3.org/TR/css-color-4/> · **CSS Color 5** — <https://www.w3.org/TR/css-color-5/>

---

*Data current as of October 2026. Library space counts are best estimates from source; exact counts shift as libraries add spaces.*
