io.github.colorjs/color-space·Media

color-space

Verified conversions across 205 color spaces: CSS strings, gamut checks, .cube LUTs

Stars
389
Version
3.3.0
License
CC0-1.0
Review
Passed
Language
JavaScript
Last commit
1h ago
Forks
31
Open issues
0
Registry update
Oct 15, 2026
acescam16colorcolor-conversioncolor-sciencecolor-spacecolorjscss-colorhdrlutmunselloklch

Connect

npm
Terminal
$claude mcp add color-space \  -- npx -y [email protected]

Environment variables

Nothing to configure — it works as is.

Security review

Review passed

Reviewed 1h ago.

metadata
scanned
packages
1 checked

No findings.

Tools

This server runs on your machine, so its tool list is not fetched before install — the README below describes what it offers.

color-space test npm size

the Ostwald hue circle at full color, shown continuously and in ten steps

Open collection of color spaces.

  • Verified formulas
  • Conventional ranges
  • JS / WASM / GLSL / LUT / ICC

Atlas →

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 205 interconnected spaces · 55 kB gzip
  • color-space/<name>.js – One standalone space
  • color-space/lite – 54-space working set · 29 kB gzip
  • color-space/wasm – lite set as WASM · bare .wasm included
  • color-space/gl – GLSL/WGSL shader source
  • color-space/gl/hlsl · color-space/gl/msl – HLSL (DirectX, Unity, Unreal) and Metal, written by naga from the WGSL · await hlsl('rgb', 'oklch') · needs the optional peer naga-wasm (it declares Node ≥ 24.12; CI runs it on 22, where npm only warns)
  • color-space/lut – .cube LUTs for Resolve, Premiere, OBS, ffmpeg — verified vs ACES
  • color-space/icc – Matrix + TRC or CLUT profiles
  • color-space/data.json – Channels, ranges, provenance, references, graph, gamuts
  • npx color-space rgb oklch 255 128 0 – CLI, no install: convert (default) · cube · icc · space · spaces · mcp (MCP server for agents)

Upgrading from v2?

Agents

MCP tools – convert · gamut · css · space · spaces · cube · shader · icc · code – so agents call verified math instead of guessing it. A color goes in as any CSS string ('#ff8000', 'oklch(0.7 0.1 50)', 'rebeccapurple') or as channel values; shader writes the conversion as GLSL, WGSL, HLSL or MSL, code gives the JS call and its verified colour-science equivalent.

claude mcp add color-space -- npx -y color-space mcp                                      # Claude Code
code --add-mcp '{"name":"color-space","command":"npx","args":["-y","color-space","mcp"]}'  # VS Code

Claude Desktop claude_desktop_config.json, any project .mcp.json:

{ "mcpServers": { "color-space": { "command": "npx", "args": ["-y", "color-space", "mcp"] } } }

Claude Code plugin (the server plus a skill): /plugin marketplace add colorjs/color-space, then /plugin install color-space@color-space. Docker: docker build -t color-space-mcp . and run it with docker run -i --rm color-space-mcp.

Over HTTP (Streamable HTTP, stateless): npx -y color-space mcp --http 8787 on localhost, or host fetch from color-space/mcp.js in a Worker, Deno or Bun. Skill for agents that load skills: plugins/claude/skills/color-space.

Spaces

Display & web
sRGB · Display P3 · Rec. 2020 · Linear-light sRGB · Rec. 709 · ProPhoto RGB · Adobe RGB (1998) · DCI-P3 · Linear Display P3 · Linear Rec. 2020 · Linear Adobe RGB (1998) · Linear ProPhoto RGB · scRGB · RIMM RGB · CIE RGB · NTSC RGB (1953) · PAL / SECAM RGB · Apple RGB · SMPTE-240M · ECI RGB v2 · Adobe Wide Gamut RGB · ColorMatch RGB · Bruce RGB · Beta RGB · Best RGB · Don RGB 4 · Ekta Space PS 5 · Russell RGB

RGB remixes
HSL · HSV / HSB · HWB · HSI · IHLS · HCG · HCL · HSP · HCY · HSM · oRGB · Prismatic

Perceptual
OKLCH · CIELAB · CAM16 · OKLab · HCT · Okhsl · Okhsv · Okhwb · OKLrAB · OKLrCH · SRLAB2 · proLab · sUCS · IgPgTg · HelmGen · HelmGen LCh · Jzazbz · JzCzHz · IPT · IPT Ragoo 2021 · Izazbz · hdr-IPT · IaPbP · CIELChab · CIELUV · HSLuv · CIELChuv · CIELAB D65 · CIELCh D65 · Msh · HPLuv · DIN99 · DIN99o Lab · DIN99o LCh · DIN99c · DIN99d · Hunter Lab · Hunter Rd,a,b · CIE 1960 UCS · CIE 1964 UVW · Adams–Nickerson Lab · hdr-CIELAB · CIECAM02 · CAM16-UCS · ZCAM · CAM02-UCS · CAM16-LCD · CAM16-SCD · CAM02-LCD · CAM02-SCD · Hellwig 2022 · sCAM · Kim 2009 · RLAB · LLAB · Nayatani 95 · Hunt · ATD95

Colorimetry & research
CIE XYZ (D65) · CIE xyY · LMS · CIE XYZ (D50) · CIE 1976 u′v′ · CCT + Duv · Color temperature (Kelvin) · Maxwell triangle · Wavelength · Absolute XYZ D65 · LogLuv · MacLeod–Boynton · DKL · Grayscale · Dominant wavelength / DSH · rg chromaticity · Yrg (Kirk 2019) · XYB · OSA-UCS · TSL · YES · Ohta I₁I₂I₃ · lαβ

Video & broadcast
BT.709 Y′CbCr · ICtCp · ICtCp HLG · IPT-PQ-C2 · BT.2020 Y′CbCr · BT.601 525-line Y′CbCr · BT.601 625-line Y′CbCr · YCbCr (parameterized) · YUV · YIQ · YPbPr · YCgCo · JPEG YCbCr · YDbDr · YcCbcCrc · xvYCC · SMPTE-C · PhotoYCC · Rec. 2100 PQ · Rec. 2100 HLG · Linear Rec. 2100 · ICaCb · Y′D′zD′x

Film & camera
ACEScg · ARRI LogC3 · ARRI Wide Gamut 3 · ACEScc · Sony S-Log3 · S-Gamut3 · Sony S-Gamut3.Cine · ACES2065-1 · ACEScct · ARRI LogC4 · ARRI Wide Gamut 4 · Cineon · DaVinci Wide Gamut / Intermediate · DaVinci Wide Gamut · Sony S-Log2 · Panasonic V-Log · V-Gamut · RED Log3G10 · REDWideGamutRGB · Canon Log · Canon Log 2 · Canon Log 3 · DCI-P3+ · Fujifilm F-Log · Fujifilm F-Log2 · Fujifilm F-Log2 C · Nikon N-Log · Apple Log · Apple Log 2 · Blackmagic Film Gen 5 · Blackmagic Wide Gamut · DJI D-Log · D-Gamut · FilmLight T-Log / E-Gamut · E-Gamut · Kinefinity KineLOG3 · DCDM X′Y′Z′ · Sony S-Log · ACESproxy · ERIMM RGB · Leica L-Log · GoPro Protune · GoPro GP-Log2 · Insta360 I-Log · Xiaomi Mi-Log · OPPO O-Log · O-Log2 · Samsung Log · REDLog · REDLogFilm · RED Log3G12 · Panalog · ViperLog · Filmic Pro 6

Print & paint
CMYK · Munsell · RYB · CMY · RAL Design · Coloroid · Ostwald

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.

LibrarySpacesRangesCamera log · CAM · historicBackendsSpeed (M op/s)¹
color-space205Conventional✅JS · WASM · GLSL/WGSL · LUT · ICC5.52
color-space/lite54Conventionallogs · HDR · CAM16JS · 29 kB gzip3.01 ²
color-space/wasm54Conventionallogs · HDR · CAM16WASM1.38–4.78× JS batches ³
culori300–1❌JS4.46
colorjs.io~400–1someJS0.23
texel/color~160–1❌JS3.49 ²
chroma-js~12mixed❌JS1.19 ²
d3-color6mixed❌JS9.35 ²

¹ geometric mean, million scalar calls per second over the 7 shared npm run benchmark conversions (rgb ⇄ lab · hsl · oklab, rgb → p3), inputs rotating through a 256-color table; median of 3 runs on 2026-10-03 as the benchmark prints it, Node 22.22 / Intel Xeon 2.1 GHz (4 vCPU), culori 4.0.2 · colorjs.io 0.5.2 · @texel/color 1.1.11 · chroma-js 3.2.0 · d3-color 3.1.0. Absolute figures move with the machine; the ratios are the claim · ² measured on the subset it implements — color-space on the same subset: lite's 4 (lab, oklab; measured before lite gained hsl and p3) 3.09 · texel's 3 (oklab, p3) 2.76 · chroma-js's 6 6.45 · d3-color's 4 (lab, hsl) 9.28 · ³ WASM speedup over the JS batch API, rgb → each of the 26 targets it had then over 1M pixels (the 27 added since are not yet measured), per-target medians of 3 further runs the same day (lowest on Jzazbz and JzCzHz)

CC0 · ॐ

From the server's repository — third-party content, read it before running anything it suggests.

More in Media

Listing from the official MCP Registry · repository facts from GitHub, 1h ago.