color

Immutable JavaScript color conversion and manipulation with CSS string support

Library
npm
v5.0.3
4,932 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
45 /100 Fair
Development Activity 0
Maintenance 20
Community 60
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
75 /100 Good
Architecture 72
Code Quality 78
Innovation 68
Learning Curve 82

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 26 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

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

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
Go
61%
Apache 2.0

Apache Answer

Community

15,683

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

View details
90
Repo Health
78
Technical
68
Dependency
Built with
Go 61%
TypeScript 36%
Updated 1 weeks ago
Rust
67%
MIT

Bun

Developer Tools

96,068

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
Rust 67%
C++ 19%
TypeScript 10%
Updated 5 days ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

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

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

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

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
TypeScript
79%
Other

Directus

CMS · Low Code Platforms

37,987

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
TypeScript 79%
Vue 19%
Updated 1 weeks ago
Python
63%
BSD 3

Flagsmith

Ab Testing Experimentation · Developer Tools · Devops

6,577

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
Python 63%
TypeScript 31%
Updated 6 days ago
TypeScript
54%
Other

Focalboard

Collaboration · Productivity · Project Management

26,491

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

View details
56
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 54%
Go 40%
Updated 4 months ago
TypeScript
51%
MIT

Ghost

Blogging · CMS

55,450

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
TypeScript 51%
JavaScript 44%
Updated 4 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