color

Immutable JavaScript color conversion and manipulation with CSS string support

Library
npm
v5.0.3
4,934 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
57 /100 Fair
Development Activity 44
Maintenance 24
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

PHP
58%
AGPL 3.0

Nextcloud Server

Collaboration · File Storage

37,265

Your own private cloud: self-hosted file sync, collaboration, and communication with no vendor lock-in.

View details
95
Repo Health
77
Technical
81
Dependency
Built with
PHP 58%
JavaScript 32%
Updated yesterday
TypeScript
50%
Other

SigNoz

Analytics · Monitoring

32,429

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 50%
Go 38%
Updated 2 days ago
TypeScript
89%
Other

Hexclave

Authentication · Developer Tools

6,877

The open-source user infrastructure platform — authentication, teams, payments, emails, analytics, and more on a single unified user model.

View details
88
Repo Health
80
Technical
66
Dependency
Built with
TypeScript 89%
Updated yesterday
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated yesterday
Rust
93%
Other

Tabby

AI Code Assistants

33,924

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
55
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 3 months ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 2 days ago
Go
54%
AGPL 3.0

Uptrace

Devops · Monitoring

4,305

Unified open-source APM that collects OpenTelemetry traces, metrics, and logs into a single self-hosted platform backed by ClickHouse.

View details
71
Repo Health
70
Technical
65
Dependency
Built with
Go 54%
Vue 34%
Updated 3 days ago
TypeScript
96%
GPL 3.0

Wire

Collaboration · Team Chat · Video Conferencing

1,192

Open source end-to-end encrypted messaging for teams and enterprises — self-host for complete control over your communications and data.

View details
93
Repo Health
8
Technical
68
Dependency
Built with
TypeScript 96%
Updated 2 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