Skip to content

Compare

color-map next to seven other color libraries. Every number is read from a data file that a script writes, and every feature cell links to its source.

Measured on 2026-11-02 with color-map 2.2.0, culori 4.0.2, colorjs.io 0.7.1, chroma-js 3.2.0, @texel/color 1.1.11, @colordx/core 7.3.0, lightningcss 1.33.0 and colord 2.10.0.

  • color-map is smaller than culori, colorjs.io and chroma-js for the same job, and larger than @texel/color and colord. Those two cover far less. @colordx/core is about 14% larger than color-map for the convert job, but its whole package (8.6 kB) is smaller than color-map’s (14.6 kB). Its plugins are not in that figure.
  • color-map converts between spaces at roughly culori’s speed (within about 15% of it, depending on the pair), and is faster at parsing, mixing and gamut mapping. It is about 3.6 times slower at toCss and about 1.8 times slower at toHex.
  • @colordx/core is faster than color-map at parsing (about 3.7 times), gamut mapping (about 4.6 times) and mixing (about 2.5 times). color-map is faster at toCss (about 2.0 times), at WCAG contrast and at conversions to Lab and Display-P3. Conversions back to sRGB favor @colordx/core by up to about 30%.
  • colorjs.io and @colordx/core have APCA contrast. color-map has no APCA yet (issue #255). colorjs.io also has more color spaces.
  • lightningcss is a native Rust CSS tool for build time. It is not a browser library, so it has no browser size.

“Unverified” means no primary source confirmed the answer. Read it as unknown, not as “no”.

Featurecolor-mapculoricolorjs.iochroma-js@texel/color@colordx/corelightningcsscolord
LicenseYes MIT, from package.json license field. sourceYes MIT. sourceYes MIT. sourceYes BSD-3-Clause AND Apache-2.0 (dual terms in the license field). sourceYes MIT. sourceYes MIT. sourceYes MPL-2.0, a file-level copyleft license. sourceYes MIT. source
Runtime dependenciesYes None. package.json has no dependencies; the CLI bundle inlines its parser. sourceYes None; package.json lists no dependencies. sourceYes None; package.json lists no dependencies. sourceYes None; package.json lists no dependencies. sourceYes None; the README says zero dependencies. sourceYes None; the README badge says 0 dependencies and package.json has no dependencies field. sourcePartial One: detect-libc. The CSS engine is a native Rust binary installed as a platform package. sourceYes None; package.json lists no dependencies. source
TypeScript types shippedYes types field points to esm/index.d.ts; every export entry has types. sourceNo No .d.ts files or types field in the 4.0.2 package. Types come from the separate @types/culori. sourceYes types field and per-export types under ./types. sourceNo No .d.ts files or types field in the 3.2.0 package. Types come from the separate @types/chroma-js. sourceYes types field points to types.d.ts. sourceYes Types field and per-subpath .d.ts files in the exports map. sourceYes types field points to node/index.d.ts. sourceYes types field points to index.d.ts; plugins ship .d.ts files. source
Tree-shakeable ESM (sideEffects/exports)Yes type module, sideEffects false, subpath exports for color, scale, palette, export. sourceYes ESM source; sideEffects lists only 3 entry files; exports ./fn gives a function-only entry. sourceYes ESM source; sideEffects lists 4 files; exports ./fn and ./spaces for selective imports. sourcePartial ESM with per-module subpath exports and a ./light build; no sideEffects field, so bundlers may keep modules. sourcePartial ESM; README says unused spaces are tree-shaken (~3.5 kB for OKLCH to sRGB). No sideEffects field. sourceYes sideEffects false; plugins and the functional API are separate subpath exports. sourceNo Native binary behind a Node API; there is no JS color code to tree-shake. Not applicable to the design. sourceYes sideEffects false; plugins are separate subpath exports. source
Color spacesYes 15: srgb, srgb-linear, hsl, hwb, lab, lch, oklab, oklch, display-p3 (and linear), a98-rgb, prophoto-rgb, rec2020, xyz-d50, xyz-d65. sourceYes Includes rgb, lrgb, hsl, hsv, hsi, hwb, lab, lch, oklab, oklch, okhsl, okhsv, p3, a98, prophoto, rec2020, jab, jch, luv, xyz50, xyz65, cubehelix. sourceYes Includes srgb, p3, a98rgb, prophoto, rec2020, rec2100, hsl, hwb, lab, lch, oklab, oklch, okhsl, okhsv, jzazbz, ictcp, cam16, hct, luv, acescg. sourcePartial rgb, hsl, hsv, hsi, cmyk, lab, lch, hcl, oklab, oklch, hcg, gl, temperature. No P3, Adobe RGB, ProPhoto or Rec.2020 module in src/io. sourcePartial Small set: xyz, oklab, oklch, okhsv, okhsl, srgb, display-p3, rec2020, a98-rgb, prophoto-rgb (plus linear forms). Others via custom spaces. sourceYes Core: sRGB, HSL, OKLab, OKLCH. Plugins add HSV, HWB, CMYK, CIE Lab/LCH, XYZ, Okhsl/Okhsv, Display-P3, Rec.2020, A98, ProPhoto and linear sRGB. sourcePartial Parses and lowers rgb, hsl, hwb, lab, lch, oklab, oklch and color() spaces such as display-p3, xyz and a98-rgb. It does not expose a color API. sourcePartial Core: rgb, hsl, hsv. Plugins add hwb, cmyk, lab, lch, xyz and names. No oklab, oklch or P3 in the package. source
CSS Color 4 string parsingYes parse(): hex, named, rgb, hsl, hwb, lab, lch, oklab, oklch, color() with 9 spaces, none. parseExpr() adds relative colors, color-mix(), light-dark(). sourcePartial Parses hex, named, rgb, hsl, hwb, lab, lch, oklab, oklch, color() and none. No relative colors, color-mix() or light-dark() in src. sourcePartial parse() reads function syntax incl. color() and none. No color-mix(), relative color or light-dark() parsing; tryColor defers those to the DOM. sourcePartial Parses hex, named, rgb, hsl, lab, lch, oklab, oklch and none. No hwb() or color() in src/io/css, and no relative, color-mix() or light-dark(). sourcePartial deserialize() reads hex, rgb(), oklch(), oklab() and plain color() only; README says complex CSS strings are out of scope. sourcePartial Core parses hex, rgb(), hsl(), oklab(), oklch() and color(srgb); plugins add lab, lch, hwb, color(display-p3 ...) and names. Handles none in color(). color-mix() and relative color are on its roadmap, not shipped. sourceYes Parses stylesheets, not strings: lab, lch, oklab, oklch, hwb, color(), color-mix(), relative colors, light-dark(); none is in the AST. sourcePartial Core parses hex, rgb, hsl; plugins add names, hwb, lch, cmyk. No oklab, oklch, color(), none, relative colors or color-mix(). source
Serialize to CSS (oklch(), color())Yes toCss() prints rgb, hsl, hwb, lab, lch, oklab, oklch and color(<space> ...); toHex() for hex. sourceYes formatCss() prints oklch(), lab(), color(display-p3 ...) and other color() forms; formatHex, formatRgb, formatHsl too. sourceYes toString() prints oklch() and other function forms, or color(<space> ...); format and precision options. sourcePartial css() prints rgb, hsl, lab, lch, oklab, oklch. No color() output. sourceYes serialize() prints rgb(), oklch() and color(display-p3 ...) with alpha. sourceYes toOklchString() and toOklabString() in core; toP3String(), toLabString() and toSrgbLinearString() with plugins. sourcePartial Output lowers or keeps lab, oklch and color() per browser targets; there is no call to serialize one color. sourcePartial Prints hex, rgb, hsl, plus hwb, cmyk, lch via plugins. No oklch() or color() output. source
Gamut mappingYes toGamut() with method css follows the CSS Color 4 OKLCH chroma reduction (section 13.2, JND 0.02); clip also available. sourceYes toGamut() defaults follow the CSS Color 4 algorithm per its source comment; also clampChroma and clampRgb. sourceYes toGamut() method css is the default; also clip, raytrace and per-coordinate reduction. sourceNo No gamut-mapping module in src; only a clipped() flag that reports clipping during conversion. sourcePartial gamutMapOKLCH() uses Ottosson's cusp method, not the CSS Color 4 algorithm; several mapping strategies. sourceYes mapSrgb() implements CSS Color 4 gamut mapping; plugins map into P3, Rec.2020, A98 and ProPhoto. sourceUnverified Docs and types show no gamut-mapping option; could not confirm how out-of-gamut lab or oklch is converted to RGB fallbacks.No No gamut or wide-gamut code in the 2.10.0 package (searched for gamut, oklab, oklch, display-p3). source
Contrast (WCAG 2 / APCA)Partial WCAG 2 ratio only; APCA is available through a documented recipe, not the CLI. sourcePartial wcagContrast and wcagLuminance; no APCA in src. sourceYes WCAG 2.1, APCA, Weber, Michelson, Lstar and DeltaPhi in src/contrast. sourceYes contrast() for WCAG 2 and contrastAPCA(); the source calls the APCA implementation beta. sourceNo No contrast or luminance function in src or README; only deltaEOK for color difference. sourceYes a11y plugin: WCAG 2 contrast() and APCA apcaContrast(), plus readability gates and fixContrast(). sourceNo Node API types expose no contrast function; it is a CSS transformer. sourcePartial WCAG 2.0 luminance, contrast and isReadable via the a11y plugin; no APCA. source
Scales, palettes, interpolationYes createScale (Tailwind, Radix, tone, even presets), brand and contrast scales, tonalPalette, semantic palette, harmony, mix(). sourceYes interpolate with easing and hints, samples, average, blend. sourceYes range(), steps(), mix() with hue interpolation modes. sourceYes scale, bezier, cubehelix, average, mix, blend and random generators in src/generator. sourcePartial Only lerp and lerpAngle; README says to build color interpolation yourself. sourcePartial mix plugin: mix, mixOklab, mixLab, tints, shades, tones and palette(n, target); harmonies plugin. No multi-stop scale or easing. sourceNo No color scale or interpolation API; checked Node API types. sourcePartial mix plugin (lab or rgb), tints, shades, tones; harmonies plugin. No multi-stop scale. source
color-mix() / relative color evaluationYes resolve() evaluates color-mix(), relative colors with calc(), light-dark() and contrast-color() given a context. sourceNo No color-mix, light-dark or relative-color code in 4.0.2 src (searched). sourceNo Not evaluated in parse; tryColor can ask the browser DOM to resolve them. mix() is a JS function, not color-mix(). sourceNo No color-mix or relative-color code in 3.2.0 src (searched). sourceNo README says complex CSS color string handling is out of scope. sourceNo Listed under Roadmap as not yet built: color-mix() strings and relative color syntax. mix() is a JS method. sourceYes Evaluates color-mix() and relative colors statically when all components are known; light-dark() lowers to a variable fallback. sourceNo The mix plugin is a JS method, not CSS color-mix(); no relative color parsing in the package. source
Runs in the browserYes ESM and CJS builds; no node: imports in src outside the CLI. sourceYes ESM source and a bundled build; no node: imports in src. sourceYes ESM source and dist bundles; no node: imports in src. sourceYes ESM source plus UMD builds; no node: imports in src. sourceYes README shows Canvas2D use; no node: imports in src. sourceYes Zero dependencies; the README publishes a gzipped bundle size and names oklch-picker, a browser app, as a user. The installed dist has no node: imports (searched). sourcePartial Native Rust parser, transformer and minifier with a Node API, so not a browser color library. A separate lightningcss-wasm package runs in browsers. sourceYes README says it supports all browsers and Node.js. source

Minified and gzipped, bundling only what each scenario imports. “Convert one color” parses #3b82f6, converts it to oklch and writes it back. colord has no oklch, so it converts to hsl, which is less work.

LibraryVersionConvert one colorWhole package
color-map2.2.0
6.0 kB
14.6 kB
culori4.0.2
14.4 kB
22.3 kB
colorjs.io (fn build)0.7.1
18.5 kB
31.3 kB
chroma-js3.2.0
16.3 kB
not tree-shakeable
@texel/color1.1.11
1.8 kB
9.1 kB
@colordx/core7.3.0
6.9 kB
8.6 kB
colord2.10.0
2.0 kB
2.1 kB
color-map, narrow path2.2.0
1.2 kB
n/a
lightningcss1.33.0not measured: a native Rust build tool

About the color-map rows:

  • parse pulls in the whole CSS parser, so the convert scenario costs 6.0 kB.
  • Without string parsing, createConverter with two spaces costs 1.2 kB. That is the fairer match for @texel/color, which takes numbers.
  • @texel/color and colord are smaller but cover far less. Check the features table before choosing on size.
  • Whole package means re-exporting everything: for color-map, color, scale, palette and export.

The budgets color-map enforces on itself are on the Library page.

Operations per second, longer bar is faster. Each library runs in its own process on 64 inputs; the figure is the median of five samples. colorjs.io uses its fastest API, colorjs.io/fn. chroma-js, @texel/color and colord are not here because they lack some of these operations. @colordx/core runs with its lab, p3, mix and a11y plugins loaded, through the colordx() class, wrapping a plain object on every call so the conversion is inside the timed work.

color-mapculoricolorjs.io@colordx/coreoperations per second, longer is faster
OperationSpeedcolor-map vs culoricolor-map vs @colordx/core
parse
1.3 M
1.1 M
414 k
4.8 M
1.2x faster3.7x slower
srgb -> oklch
5.8 M
6.7 M
1.8 M
5.5 M
1.1x slower1.1x faster
oklch -> srgb
5.7 M
6.0 M
1.6 M
7.7 M
about the same1.3x slower
srgb -> oklab
8.8 M
9.0 M
2.1 M
6.9 M
about the same1.3x faster
oklab -> srgb
7.2 M
7.6 M
2.0 M
9.5 M
about the same1.3x slower
srgb -> lab
8.6 M
8.6 M
1.2 M
6.1 M
about the same1.4x faster
lab -> srgb
7.4 M
7.0 M
1.3 M
5.5 M
1.1x faster1.3x faster
srgb -> display-p3
7.9 M
7.2 M
1.8 M
6.5 M
1.1x faster1.2x faster
display-p3 -> srgb
7.8 M
7.0 M
1.7 M
5.4 M
1.1x faster1.4x faster
toCss (oklch)
5.5 M
19.8 M
1.2 M
2.8 M
3.6x slower2.0x faster
toHex (srgb)
11.4 M
20.0 M
1.7 M
10.6 M
1.8x slower1.1x faster
toGamut css (oklch)
274 k
200 k
81 k
1.3 M
1.4x faster4.6x slower
mix oklab
1.1 M
680 k
423 k
2.8 M
1.6x faster2.5x slower
contrast wcag2
6.0 M
5.2 M
530 k
3.8 M
1.2x faster1.6x faster

Run on AMD Ryzen 7 5800X 8-Core Processor, Linux 6.18.54.1-microsoft-standard-WSL2, Node v26.7.0. Compare the bars, not the absolute figures.

Against culori, color-map is clearly slower only at toCss and toHex.

  • Size: size-limit 14.3.0 with @size-limit/preset-small-lib (minified, gzip). One entry file per scenario, tree-shaken named imports. The script is {data.method.script}. Competitor versions are pinned in the private color-map-compare workspace package, so they never reach color-map’s published dependencies.
  • Speed: the repository’s own benchmark, pnpm --filter color-map bench. It was written by the color-map authors, who chose the operations and inputs. Treat it as a guide, not a verdict.
  • Features: read from each project’s documentation and source at the version named above. A few “No” cells rest on a search of the installed source, not on a page that states the absence: culori and chroma-js color-mix and relative color, colord gamut mapping, and @texel/color contrast. A newer release can change a cell. chroma-js documents behavior in releases newer than 3.2.0, and cells say so when that matters.
  • Rerun: run pnpm --filter color-map build, then pnpm --filter color-map-compare measure, and commit apps/website/src/data/compare.json.
  • Not covered: accuracy of the results, memory use, and server-side speed of lightningcss.