color
Immutable JavaScript color conversion and manipulation with CSS string support
Repository Health
Technical Analysis
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
Ghostfolio
Invoicing Finance
Track your stocks, ETFs, and crypto with a privacy-first, self-hostable wealth management platform built for data-driven investors.
GraphQL Hive
Developer Tools · Devops · Monitoring
Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.
Joplin
Note Taking
The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.
Logto
Authentication
Open-source auth infrastructure for SaaS and AI apps with OIDC, SAML, and RBAC
Magic
AI Agents · Automation · Low Code Platforms
Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.
Markdrop
Note Taking
Visual drag-and-drop markdown editor with GitHub-specific blocks, cloud sync, and offline PWA support
Metabase
Analytics
The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.
Openship
Devops · Hosting Control Panel
Openship is an open-source, self-hostable deployment platform that points at a repo and builds, ships, routes, and TLS-terminates the app — driven from a desktop app, web dashboard, or CLI.
Sentry
Analytics · Developer Tools · Monitoring
Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.