JavaScript Library
10.6k 2026-04-30
gka/chroma.js
A zero-dependency JavaScript library for comprehensive color conversions, manipulations, and scale generation.
Core Features
Extensive color conversions (e.g., hex, RGB, HSL, Lab, Lch)
Intuitive color manipulation (e.g., darken, lighten, mix)
Advanced color scale generation with custom domains and modes
Support for quantiles and logarithmic color scales
Zero-dependency and small footprint for efficient use
Quick Start
npm install chroma-jsDetailed Introduction
Chroma.js is a lightweight, zero-dependency JavaScript library designed for robust color handling. It provides a powerful API for converting colors between various models (RGB, HSL, Lab, Lch), manipulating color properties, and generating sophisticated color scales. Its capabilities extend to creating custom domains, quantiles, and logarithmic scales, making it an invaluable tool for data visualization, UI/UX design, and any application requiring precise and flexible color management in both browser and Node.js environments.