chroma.js

JavaScript library for color conversion, manipulation, and scale generation

Library
npm
v3.2.0
10,574stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
53/100Fair
Development Activity20
Maintenance20
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture76
Code Quality74
Innovation70
Learning Curve84

chroma.js is a small library for all kinds of color operations in the browser and Node.js: converting between color spaces (RGB, HSL, LAB, LCH, HSV, and more), reading colors from CSS strings, named colors, or hex/temperature values, and generating smooth color scales and palettes for maps and charts. It bundles the classic ColorBrewer palettes and X11/CSS named colors out of the box, so data-visualization projects can pull in perceptually reasonable color ramps without hand-picking hex values.

The library exposes a chainable chroma() API for building up color transformations (darken, brighten, saturate, mix, blend) and a chroma.scale() API for interpolating between colors across a domain, commonly used to color choropleth maps, heatmaps, and data-driven charts.

What You Get

  • Color parsing and conversion across RGB, HSL, HSV, LAB, LCH, CMYK, and named/hex/CSS color strings
  • A chainable color-manipulation API (darken, brighten, saturate, desaturate, alpha, mix, blend)
  • A chroma.scale() API for building continuous or discretized color scales/gradients between multiple colors
  • Built-in ColorBrewer palettes and X11/CSS named colors ready to use as scale inputs
  • Color-distance and contrast utilities for accessibility and perceptual-difference checks

Common Use Cases

  • Coloring choropleth maps and heatmaps by interpolating a value across a color scale
  • Generating data-visualization color palettes (sequential, diverging, categorical) from ColorBrewer presets
  • Programmatically lightening, darkening, or blending brand colors for hover/active UI states
  • Converting user-supplied or design-token colors between formats (hex, RGB, HSL) for theming systems

Under The Hood

Architecture: The chroma() factory in Color.js normalizes any input format through src/io/input.js, which dispatches to per-space parsers under src/io/ (hex, css, named, cmyk, hsl, hsv, lab, lch, gl, num), converting everything to an internal RGB representation that manipulation methods (darken, saturate, mix) and src/generator/src/interpolator scale logic operate on before re-serializing back out through the same io modules on demand. Tech Stack: Written in modern JavaScript (ESM, ships both index.js ESM and dist/chroma.cjs CJS/UMD builds via Rollup), with a handful of legacy .coffee files still present in the io layer (delta-e, distance) alongside newer plain-JS modules, built and tested with pnpm and Vitest. Code Quality: A large test/ directory (50+ files) covers each color-space converter and the scale/interpolation logic individually, giving good regression coverage for a library where subtle color-math bugs are easy to introduce; the codebase shows its age in a mix of coding styles (CoffeeScript remnants alongside ES modules) reflecting over a decade of incremental maintenance. API Design: The chainable chroma(color).method().method() style and the single chroma.scale() entry point for gradients keep the common cases terse, though the breadth of supported color-space names and options makes the full API surface non-trivial to memorize without consulting docs.

Used by 25 apps in this directory

TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Go
76%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,199

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
Go76%
TypeScript22%
Updated today
TypeScript
88%
MIT

DevTools-X

Developer Tools

1,532

41 offline-first developer utilities in a single 10MB cross-platform desktop app — no Electron, no cloud, no compromise.

View details
51
Repo Health
68
Technical
68
Dependency
Built with
TypeScript88%
Updated 2 months ago
TypeScript
80%
Other

Directus

CMS · Low Code Platforms

37,462

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
93
Repo Health
82
Technical
78
Dependency
Built with
TypeScript80%
Vue18%
Updated yesterday
JavaScript
52%
MIT

evidence

Analytics · Data Engineering

6,861

Turn SQL queries and markdown files into polished, interactive data apps and business intelligence reports — no drag-and-drop, no GUI, just code.

View details
65
Repo Health
79
Technical
65
Dependency
Built with
JavaScript52%
Svelte40%
Updated today
TypeScript
91%
MIT

GB Studio

Developer Tools · Game Development · Design Tools

9,372

Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.

View details
89
Repo Health
83
Technical
80
Dependency
Built with
TypeScript91%
Updated today
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,186

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
79
Repo Health
76
Technical
70
Dependency
Built with
TypeScript98%
Updated yesterday
PHP
57%
Other

Hi.Events

Ecommerce · Scheduling

3,985

Self-hosted event ticketing platform that keeps your attendee data, brand, and revenue completely under your control.

View details
88
Repo Health
84
Technical
67
Dependency
Built with
PHP57%
TypeScript37%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search