color-space [](https://github.com/colorjs/color-space/actions/workflows/test.yml) [](https://npmjs.org/color-space) [](https://bundlephobia.com/package/color-space)
August 11, 2026 · View on GitHub
Open collection of color spaces.
- Verified formulas
- Conventional ranges
- JS / WASM / GLSL / LUT / ICC
Use
import space from 'color-space';
space.rgb.oklch(255, 128, 0); // → [0.732, 0.186, 53] — modern CSS
space.slog3.rec2020(0.5, 0.5, 0.5); // camera log → UHD wide gamut
space.rgb.xyz(300, -10, 0); // → [59.7, 30.6, 2.8] — out-of-range in, unclamped out
// batch
space.rgb.oklch([255, 128, 0, 0, 255, 128]); // [0.732, 0.186, 53, 0.875, 0.234, 151]
// meta
space.lab.range; // [[0, 100], [-125, 125], [-125, 125]]
Individual spaces:
import oklch from 'color-space/oklch.js';
oklch.rgb(0.65, 0.25, 180); // matches CSS oklch(0.65 0.25 180)
Imports
color-space– All 162 interconnected spaces · 55 kB gzipcolor-space/<name>.js– One standalone spacecolor-space/lite– 27-space working set · 9 kB gzipcolor-space/wasm– lite set as WASM · bare.wasmincludedcolor-space/gl– GLSL/WGSL shader sourcecolor-space/lut–.cubeLUTs for Resolve, Premiere, OBS, ffmpeg — verified vs ACEScolor-space/icc– Matrix + TRC or CLUT profilescolor-space/data.json– Channels, ranges, provenance, references, graph, gamutsnpx color-space rgb oklch 255 128 0– CLI, no install:convert(default) ·cube·icc·space·spaces·mcp(the same tools over MCP stdio for agents)
Spaces
Motivation
A complete collection of color spaces: one minimal API, verified formulas. While alternatives focus on digital color spaces, this project takes broader perspective, covering historical and cross-disciplinary spaces as well. Side effects: corrected papers, color education, test cases for JS→WASM compilers (porffor, jz).
It is not a color toolbox — parsing, interpolation, ΔE, gamut mapping, contrast, palettes, alpha stay out. Pantone, NCS, RAL Classic, and similar licensed swatch catalogs aren't open and stay out as well.
Credits
Thanks to the researchers, theorists, specifiers, implementors and the libraries that helped this one happen.
| Library | Spaces | Ranges | Camera log · CAM · historic | Backends | Speed (M op/s) |
|---|---|---|---|---|---|
| color-space | 162 | Conventional | ✅ | JS · WASM · GLSL/WGSL · LUT · ICC | 36.4 |
| color-space/lite | 27 | Conventional | logs · HDR | JS · 9 kB gzip | 36.4 |
| color-space/wasm | 27 | Conventional | logs · HDR | WASM | 1.3–2.5× JS batches |
| culori | ~35 | 0–1 | ❌ | JS | 16.1 |
| colorjs.io | ~40 | 0–1 | some | JS | 0.7 |
| texel/color | ~16 | 0–1 | ❌ | JS | 15.9 |
| chroma-js | ~12 | mixed | ❌ | JS | 3.4 |
| d3-color | 6 | mixed | ❌ | JS | 34.4 |