Home

chromajs

Chroma.js, often written chroma.js or chroma-js, is a JavaScript library that provides color manipulation and color scale utilities for web development and data visualization. It offers color parsing, conversion between color spaces, and interpolation to generate smooth gradients.

Input formats include hex, RGB(A), HSL(A), and named colors; outputs can be requested in several representations.

Usage is lightweight and cross-environment: it runs in browsers and in Node.js. The API centers on a

Chroma.js is maintained as an open-source project with contributions from a community of developers. It is widely

A
distinguishing
feature
is
perceptual
color
interpolation
using
spaces
like
Lab
or
LCh,
which
yields
more
natural
transitions
than
naive
RGB
interpolation.
It
also
provides
ready-to-use
color
scales
and
palettes
that
cover
sequential,
diverging,
and
qualitative
schemes,
suitable
for
mapping
numeric
data
to
colors.
color
factory
that
can
be
extended
into
scale
utilities;
developers
often
integrate
chroma.js
with
visualization
libraries
such
as
D3
or
Canvas
drawing
routines.
used
in
tutorials
and
data-visualization
projects
for
its
straightforward
API
and
robust
color
operations.