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.
Summary
Section titled “Summary”color-mapis smaller than culori, colorjs.io and chroma-js for the same job, and larger than@texel/colorandcolord. Those two cover far less.@colordx/coreis about 14% larger thancolor-mapfor the convert job, but its whole package (8.6 kB) is smaller thancolor-map’s (14.6 kB). Its plugins are not in that figure.color-mapconverts 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 attoCssand about 1.8 times slower attoHex.@colordx/coreis faster thancolor-mapat parsing (about 3.7 times), gamut mapping (about 4.6 times) and mixing (about 2.5 times).color-mapis faster attoCss(about 2.0 times), at WCAG contrast and at conversions to Lab and Display-P3. Conversions back to sRGB favor@colordx/coreby up to about 30%.- colorjs.io and
@colordx/corehave APCA contrast.color-maphas 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.
Features
Section titled “Features”“Unverified” means no primary source confirmed the answer. Read it as unknown, not as “no”.
| Feature | color-map | culori | colorjs.io | chroma-js | @texel/color | @colordx/core | lightningcss | colord |
|---|---|---|---|---|---|---|---|---|
| License | Yes MIT, from package.json license field. source | Yes MIT. source | Yes MIT. source | Yes BSD-3-Clause AND Apache-2.0 (dual terms in the license field). source | Yes MIT. source | Yes MIT. source | Yes MPL-2.0, a file-level copyleft license. source | Yes MIT. source |
| Runtime dependencies | Yes None. package.json has no dependencies; the CLI bundle inlines its parser. source | Yes None; package.json lists no dependencies. source | Yes None; package.json lists no dependencies. source | Yes None; package.json lists no dependencies. source | Yes None; the README says zero dependencies. source | Yes None; the README badge says 0 dependencies and package.json has no dependencies field. source | Partial One: detect-libc. The CSS engine is a native Rust binary installed as a platform package. source | Yes None; package.json lists no dependencies. source |
| TypeScript types shipped | Yes types field points to esm/index.d.ts; every export entry has types. source | No No .d.ts files or types field in the 4.0.2 package. Types come from the separate @types/culori. source | Yes types field and per-export types under ./types. source | No No .d.ts files or types field in the 3.2.0 package. Types come from the separate @types/chroma-js. source | Yes types field points to types.d.ts. source | Yes Types field and per-subpath .d.ts files in the exports map. source | Yes types field points to node/index.d.ts. source | Yes 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. source | Yes ESM source; sideEffects lists only 3 entry files; exports ./fn gives a function-only entry. source | Yes ESM source; sideEffects lists 4 files; exports ./fn and ./spaces for selective imports. source | Partial ESM with per-module subpath exports and a ./light build; no sideEffects field, so bundlers may keep modules. source | Partial ESM; README says unused spaces are tree-shaken (~3.5 kB for OKLCH to sRGB). No sideEffects field. source | Yes sideEffects false; plugins and the functional API are separate subpath exports. source | No Native binary behind a Node API; there is no JS color code to tree-shake. Not applicable to the design. source | Yes sideEffects false; plugins are separate subpath exports. source |
| Color spaces | Yes 15: srgb, srgb-linear, hsl, hwb, lab, lch, oklab, oklch, display-p3 (and linear), a98-rgb, prophoto-rgb, rec2020, xyz-d50, xyz-d65. source | Yes Includes rgb, lrgb, hsl, hsv, hsi, hwb, lab, lch, oklab, oklch, okhsl, okhsv, p3, a98, prophoto, rec2020, jab, jch, luv, xyz50, xyz65, cubehelix. source | Yes Includes srgb, p3, a98rgb, prophoto, rec2020, rec2100, hsl, hwb, lab, lch, oklab, oklch, okhsl, okhsv, jzazbz, ictcp, cam16, hct, luv, acescg. source | Partial 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. source | Partial Small set: xyz, oklab, oklch, okhsv, okhsl, srgb, display-p3, rec2020, a98-rgb, prophoto-rgb (plus linear forms). Others via custom spaces. source | Yes 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. source | Partial 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. source | Partial 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 parsing | Yes parse(): hex, named, rgb, hsl, hwb, lab, lch, oklab, oklch, color() with 9 spaces, none. parseExpr() adds relative colors, color-mix(), light-dark(). source | Partial Parses hex, named, rgb, hsl, hwb, lab, lch, oklab, oklch, color() and none. No relative colors, color-mix() or light-dark() in src. source | Partial parse() reads function syntax incl. color() and none. No color-mix(), relative color or light-dark() parsing; tryColor defers those to the DOM. source | Partial 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(). source | Partial deserialize() reads hex, rgb(), oklch(), oklab() and plain color() only; README says complex CSS strings are out of scope. source | Partial 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. source | Yes Parses stylesheets, not strings: lab, lch, oklab, oklch, hwb, color(), color-mix(), relative colors, light-dark(); none is in the AST. source | Partial 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. source | Yes formatCss() prints oklch(), lab(), color(display-p3 ...) and other color() forms; formatHex, formatRgb, formatHsl too. source | Yes toString() prints oklch() and other function forms, or color(<space> ...); format and precision options. source | Partial css() prints rgb, hsl, lab, lch, oklab, oklch. No color() output. source | Yes serialize() prints rgb(), oklch() and color(display-p3 ...) with alpha. source | Yes toOklchString() and toOklabString() in core; toP3String(), toLabString() and toSrgbLinearString() with plugins. source | Partial Output lowers or keeps lab, oklch and color() per browser targets; there is no call to serialize one color. source | Partial Prints hex, rgb, hsl, plus hwb, cmyk, lch via plugins. No oklch() or color() output. source |
| Gamut mapping | Yes toGamut() with method css follows the CSS Color 4 OKLCH chroma reduction (section 13.2, JND 0.02); clip also available. source | Yes toGamut() defaults follow the CSS Color 4 algorithm per its source comment; also clampChroma and clampRgb. source | Yes toGamut() method css is the default; also clip, raytrace and per-coordinate reduction. source | No No gamut-mapping module in src; only a clipped() flag that reports clipping during conversion. source | Partial gamutMapOKLCH() uses Ottosson's cusp method, not the CSS Color 4 algorithm; several mapping strategies. source | Yes mapSrgb() implements CSS Color 4 gamut mapping; plugins map into P3, Rec.2020, A98 and ProPhoto. source | Unverified 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. source | Partial wcagContrast and wcagLuminance; no APCA in src. source | Yes WCAG 2.1, APCA, Weber, Michelson, Lstar and DeltaPhi in src/contrast. source | Yes contrast() for WCAG 2 and contrastAPCA(); the source calls the APCA implementation beta. source | No No contrast or luminance function in src or README; only deltaEOK for color difference. source | Yes a11y plugin: WCAG 2 contrast() and APCA apcaContrast(), plus readability gates and fixContrast(). source | No Node API types expose no contrast function; it is a CSS transformer. source | Partial WCAG 2.0 luminance, contrast and isReadable via the a11y plugin; no APCA. source |
| Scales, palettes, interpolation | Yes createScale (Tailwind, Radix, tone, even presets), brand and contrast scales, tonalPalette, semantic palette, harmony, mix(). source | Yes interpolate with easing and hints, samples, average, blend. source | Yes range(), steps(), mix() with hue interpolation modes. source | Yes scale, bezier, cubehelix, average, mix, blend and random generators in src/generator. source | Partial Only lerp and lerpAngle; README says to build color interpolation yourself. source | Partial mix plugin: mix, mixOklab, mixLab, tints, shades, tones and palette(n, target); harmonies plugin. No multi-stop scale or easing. source | No No color scale or interpolation API; checked Node API types. source | Partial mix plugin (lab or rgb), tints, shades, tones; harmonies plugin. No multi-stop scale. source |
| color-mix() / relative color evaluation | Yes resolve() evaluates color-mix(), relative colors with calc(), light-dark() and contrast-color() given a context. source | No No color-mix, light-dark or relative-color code in 4.0.2 src (searched). source | No Not evaluated in parse; tryColor can ask the browser DOM to resolve them. mix() is a JS function, not color-mix(). source | No No color-mix or relative-color code in 3.2.0 src (searched). source | No README says complex CSS color string handling is out of scope. source | No Listed under Roadmap as not yet built: color-mix() strings and relative color syntax. mix() is a JS method. source | Yes Evaluates color-mix() and relative colors statically when all components are known; light-dark() lowers to a variable fallback. source | No The mix plugin is a JS method, not CSS color-mix(); no relative color parsing in the package. source |
| Runs in the browser | Yes ESM and CJS builds; no node: imports in src outside the CLI. source | Yes ESM source and a bundled build; no node: imports in src. source | Yes ESM source and dist bundles; no node: imports in src. source | Yes ESM source plus UMD builds; no node: imports in src. source | Yes README shows Canvas2D use; no node: imports in src. source | Yes 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). source | Partial Native Rust parser, transformer and minifier with a Node API, so not a browser color library. A separate lightningcss-wasm package runs in browsers. source | Yes README says it supports all browsers and Node.js. source |
Browser size
Section titled “Browser size”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.
| Library | Version | Convert one color | Whole package |
|---|---|---|---|
| color-map | 2.2.0 | 14.6 kB | |
| culori | 4.0.2 | 22.3 kB | |
| colorjs.io (fn build) | 0.7.1 | 31.3 kB | |
| chroma-js | 3.2.0 | not tree-shakeable | |
| @texel/color | 1.1.11 | 9.1 kB | |
| @colordx/core | 7.3.0 | 8.6 kB | |
| colord | 2.10.0 | 2.1 kB | |
| color-map, narrow path | 2.2.0 | n/a | |
| lightningcss | 1.33.0 | not measured: a native Rust build tool | |
About the color-map rows:
parsepulls in the whole CSS parser, so the convert scenario costs 6.0 kB.- Without string parsing,
createConverterwith two spaces costs 1.2 kB. That is the fairer match for@texel/color, which takes numbers. @texel/colorandcolordare smaller but cover far less. Check the features table before choosing on size.- Whole package means re-exporting everything: for
color-map,color,scale,paletteandexport.
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.
| Operation | Speed | color-map vs culori | color-map vs @colordx/core |
|---|---|---|---|
| parse | 1.2x faster | 3.7x slower | |
| srgb -> oklch | 1.1x slower | 1.1x faster | |
| oklch -> srgb | about the same | 1.3x slower | |
| srgb -> oklab | about the same | 1.3x faster | |
| oklab -> srgb | about the same | 1.3x slower | |
| srgb -> lab | about the same | 1.4x faster | |
| lab -> srgb | 1.1x faster | 1.3x faster | |
| srgb -> display-p3 | 1.1x faster | 1.2x faster | |
| display-p3 -> srgb | 1.1x faster | 1.4x faster | |
| toCss (oklch) | 3.6x slower | 2.0x faster | |
| toHex (srgb) | 1.8x slower | 1.1x faster | |
| toGamut css (oklch) | 1.4x faster | 4.6x slower | |
| mix oklab | 1.6x faster | 2.5x slower | |
| contrast wcag2 | 1.2x faster | 1.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.
Method and caveats
Section titled “Method and caveats”- 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 privatecolor-map-compareworkspace package, so they never reachcolor-map’s published dependencies. - Speed: the repository’s own benchmark,
pnpm --filter color-map bench. It was written by thecolor-mapauthors, 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, thenpnpm --filter color-map-compare measure, and commitapps/website/src/data/compare.json. - Not covered: accuracy of the results, memory use, and server-side speed of lightningcss.