color

Immutable JavaScript color conversion and manipulation with CSS string support

Library
npm
v5.0.3
4,936stars
MIT License

Repository Health

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

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture72
Code Quality78
Innovation68
Learning Curve82

color is a small, dependency-light JavaScript library for parsing, converting, and manipulating colors across virtually every color space in common use — RGB, HSL, HSV, CMYK, HWB, LAB, LCH, HCG, ANSI16/256, and Apple RGB. It accepts CSS color strings, named colors, and plain object/array inputs, and returns an immutable Color instance that supports chained transformations.

Built on top of color-convert and color-string, it exposes manipulation helpers like lighten, darken, saturate, rotate, mix, and grayscale, plus WCAG-relevant utilities such as luminosity, contrast, and isLight/isDark for accessible UI decisions. Its small footprint and broad format coverage make it a common dependency inside design tools, CLI colorizers, and CSS preprocessing utilities.

What You Get

  • Parsing of CSS strings, named colors, hex, and object/array inputs across 11 color models
  • Chainable, immutable manipulation methods (lighten, darken, saturate, rotate, mix, grayscale)
  • WCAG luminosity and contrast-ratio calculations for accessibility-aware color decisions
  • Getters for individual channels and conversion to hex, rgb number, or CSS string output
  • TypeScript type definitions shipped alongside the package

Common Use Cases

  • Generating accessible text/background color pairs by computing WCAG contrast ratios
  • Building design-tool or theming utilities that need to lighten/darken a base brand color
  • CLI tools that colorize terminal output using ANSI16/256 color model conversions
  • CSS-in-JS or preprocessing tooling that manipulates colors programmatically at build time

Under The Hood

Architecture - The library is a thin, functional wrapper (index.js) around two sibling packages — color-convert for cross-model numeric conversion and color-string for parsing/serializing CSS-syntax strings — exposing a single Color factory that stores an internal {model, color, valpha} triple and lazily converts between spaces on demand. Tech Stack - Modern ESM-only package ("type": "module") targeting Node >=18, written in plain JavaScript with shipped .d.ts type definitions, zero runtime dependencies beyond color-convert/color-string. Code Quality - Tests run via mocha with xo (ESLint preset) for linting and tsd for type-definition testing, giving both runtime and type-level coverage; the test directory covers each color model and manipulation method. API Design - The chainable, immutable API (Color('#7743CE').alpha(0.5).lighten(0.5).hsl().string()) is a well-known ergonomic pattern that keeps call sites terse while avoiding mutation surprises, though the breadth of supported color models does add some API surface to learn.

Used by 25 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,588

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
74
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated yesterday
Go
60%
Apache 2.0

Apache Answer

Community

15,665

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
83
Repo Health
78
Technical
68
Dependency
Built with
Go60%
TypeScript36%
Updated 1 weeks ago
Rust
67%
MIT

Bun

Developer Tools

95,895

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust67%
C++19%
Updated yesterday
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

51,521

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,640

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
69
Repo Health
76
Technical
62
Dependency
Built with
JavaScript90%
Updated 1 weeks ago
TypeScript
81%
Other

Directus

CMS · Low Code Platforms

37,783

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
92
Repo Health
82
Technical
76
Dependency
Built with
TypeScript81%
Vue18%
Updated 3 days ago
Python
63%
BSD 3

Flagsmith

Developer Tools · Devops · Ab Testing Experimentation

6,539

Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.

View details
90
Repo Health
82
Technical
63
Dependency
Built with
Python63%
TypeScript31%
Updated 2 days ago
TypeScript
54%
Other

Focalboard

Productivity · Project Management · Collaboration

26,448

Self-hosted, open source project management with Kanban, table, gallery, and calendar views — a privacy-first alternative to Trello, Notion, and Asana.

View details
57
Repo Health
82
Technical
64
Dependency
Built with
TypeScript54%
Go40%
Updated 3 months ago
JavaScript
47%
MIT

Ghost

CMS · Blogging

55,191

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
JavaScript47%
TypeScript47%
Updated yesterday

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