# d3-color: 5.7 out of 10

Reasonable, with limits. 5th of 7 in [Color libraries](https://elestia.ai/opensource/colors/index.md).

d3-color is D3's small color module. It parses CSS colors and converts them between RGB, HSL, Lab, HCL and Cubehelix, and it has no dependencies. It is solid inside D3 visualizations. For new standalone color work, Culori or Color.js are better choices: d3-color still lacks OKLCH, CSS Color 4 parsing and gamut mapping.

**Best for:** D3 and data-visualization projects that need simple, reliable conversion between RGB, HSL, Lab and HCL, and nothing more.

## Scores

- **Overall: 5.7** (likely 4.7 to 6.8)
  - Claude Opus 5.5 (5.0): It is a reliable, tiny module that is already present wherever D3 is. As a new choice for the category's job, though, it falls behind Culori and Color.js, because it lacks OKLCH, CSS Color 4 and gamut mapping and development has nearly stopped. Pick it only if you are already in D3 and need its color spaces.
  - GPT-6.2 Sol (6.4): d3-color remains a solid choice for new D3 charts that work with classic CSS colors and need Lab, LCh or Cubehelix. Culori is a better standalone choice for projects that need CSS Color 4 inputs and built-in mixing. The recent patch supports continued use, but slow feature development and uncertain direct adoption limit the recommendation.
- **Needed by many: 4.2** (likely 3.2 to 5.3)
  - Claude Opus 5.5 (4.0): Few JS developers need to parse, convert and mix colors directly. d3-color's take leans toward data visualization and the D3 ecosystem, so it is narrower than general-purpose peers. It still runs on any runtime.
  - GPT-6.2 Sol (4.4): Programmatic color conversion serves charts, palette tools and editors, and d3-color can run without a framework. Its focus on classic CSS input makes it a narrower fit for current design tooling. The available surveys cover CSS users or visualization specialists, so the share of all JavaScript developers who need this API is uncertain.
- **Helps a lot: 5.7** (likely 4.6 to 6.7)
  - Claude Opus 5.5 (5.0): It does its core conversions correctly and its API is clean, and the ReDoS bug in the parser was fixed in 3.1.0. It lacks OKLab/OKLCH, CSS Color 4 syntax, gamut mapping, delta-E and contrast, so Culori and Color.js now do the same job clearly better. It ships no types of its own. AI agents know the API well because D3 is so widely used.
  - GPT-6.2 Sol (6.3): Version 3.1.1 has clear examples for conversion and formatting, and a third-party numerical check found close agreement on Cubehelix conversions. Culori handles modern CSS syntax and interpolation in one package, while d3-color needs d3-interpolate for mixing and a separate package for types. The feature gaps are clear, but evidence on end-to-end speed and coding-agent accuracy is limited.
- **Holds up over time: 5.4** (likely 4.3 to 7.1)
  - Claude Opus 5.5 (5.0): The D3 org and Observable keep it alive, and so much of the ecosystem depends on it that it will not vanish. Activity is minimal, though: one commit and one tooling-only release in the last year, long-open feature issues, and an unanswered security report. It is a safe bet to stay as it is, but not to gain modern color spaces.
  - GPT-6.2 Sol (5.8): D3 still depends on the module, and the November 2026 patch updated packaging and release tooling after a gap of more than four years. The repository recorded one commit in the past year, and the CSS Color 4 request has stayed open for years. Recharts documented build breakage from the earlier D3 move to ES modules, and the release history gives limited visibility into who else can publish fixes.
- **Used widely: 6.3** (likely 5.0 to 7.4)
  - Claude Opus 5.5 (6.0): Its 421M downloads in 4 weeks are the most in the category. Most of them come in transitively through d3-interpolate, d3-scale and chart libraries such as Recharts. Its download ratio of 6.4 is above the 4.1 median, but that mostly tracks D3's own spread rather than people choosing it directly. Its 133k dependent repos point to tens of thousands of direct users, fewer than color or colord have.
  - GPT-6.2 Sol (6.5): Four-week installs grew from 66 million to 421 million, a 6.37× increase against the catalog median of 4.1×. Ecosyste.ms found about 134,000 dependent repositories, more than for chroma.js and fewer than for colord, TinyColor or color. D3 and d3-interpolate install it automatically, so both the number of direct choices and their growth remain uncertain.
- **Vouched for: 6.6** (likely 5.0 to 7.6)
  - Claude Opus 5.5 (6.0): It ships inside D3, which major chart libraries and Observable run in production, and Culori says it builds on d3-color's ideas. Independent color-library comparisons in 2026 mostly leave it out or recommend Culori, Color.js or chroma.js instead. Its backing comes from D3's reputation rather than from standalone endorsements.
  - GPT-6.2 Sol (7.1): Vega's interpolation stack pulls in d3-color, and runZero lists the package in its shipped software. Independent numerical checks support its Cubehelix conversion, and visualization practitioners rate D3.js among their favorite tools. Most of the adoption and survey evidence concerns the wider D3 stack, so satisfaction with d3-color as a standalone library is harder to judge.
- **Safe: 7.1** (likely 5.5 to 8.2)
  - Claude Opus 5.5 (7.0): It has no dependencies, uses the permissive ISC licence and now publishes through npm trusted publishing. Its one advisory, a high-severity ReDoS, was fixed in 3.1.0, but the fix was not backported to 1.x or 2.x, which many trees still pull in. Its Scorecard is low at 2.8, and an unverified prototype-pollution report has had no response.
  - GPT-6.2 Sol (7.1): The package has zero runtime dependencies, uses the permissive ISC licence and adopted npm trusted publishing in 3.1.1. The high-severity denial-of-service issue was fixed in 3.1.0, about nine months after Snyk published it, and the bundle shows no advisories in the past two years. The 2.8 OpenSSF Scorecard and weak checks for branch protection, review, dependency pinning and security policy leave uncertainty about release safeguards.

## Good

- It has no dependencies, it is tiny and tree-shakeable, and it is ISC-licensed.
- Its API is simple and consistent for RGB, HSL, Lab, HCL and Cubehelix, and it plugs straight into d3-interpolate and d3-scale.
- It is stable and mature, with almost no breaking changes since v3, and it is now published through npm trusted publishing.
- Vast numbers of chart libraries install it through D3, so its behaviour is well known.

## Bad

- It has no OKLab or OKLCH and does not parse CSS Color 4 (issues #87 and #96 have been open for years).
- It has no gamut mapping, delta-E or WCAG contrast helpers, all of which Culori and Color.js provide.
- It ships no built-in TypeScript types; you need @types/d3-color from DefinitelyTyped.
- Development is slow: the one 2026 release changed only tooling, and a prototype-pollution report from April 2026 has no response.

## The numbers

- Downloads, 4 weeks: 421M
- In a year: ×6.4
- GitHub stars: 428
- Commits, 12 months: 1
- Last npm release: Nov 2026
- Advisories, 24 months: 0
- Licence: ISC
- GitHub: https://github.com/d3/d3-color
- npm: https://www.npmjs.com/package/d3-color

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
