Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


JavaScript library for all kinds of color manipulations

Subscribe to updates I use chroma.js

Statistics on chroma.js

Number of watchers on Github 4947
Number of open issues 16
Average time to close an issue 2 months
Main language CoffeeScript
Average time to merge a PR 13 days
Open pull requests 10+
Closed pull requests 9+
Last commit almost 2 years ago
Repo Created almost 8 years ago
Repo Last Updated over 1 year ago
Size 1.83 MB
Homepage http://gka.github...
Organization / Authorgka
Latest Release1.3.5
Page Updated
Do you use chroma.js? Leave a review!
View open issues (16)
View chroma.js activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating chroma.js for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


Chroma.js is a tiny JavaScript library (14kB) for all kinds of color conversions and color scales.

Build Status


Initiate and manipulate colors:

chroma('#D4F880').darken().hex();  // #9BC04B

Working with color scales is easy, too:

scale = chroma.scale(['white', 'red']);
scale(0.5).hex(); // #FF7F7F

Lab/Lch interpolation looks better than RGB

chroma.scale(['white', 'red']).mode('lab');

Custom domains! Quantiles! Color Brewer!!

chroma.scale('RdYlBu').domain(myValues, 7, 'quantiles');

And why not use logarithmic color scales once in your life?

chroma.scale(['lightyellow', 'navy']).domain([1, 100000], 7, 'log');

Like it?

Why not dive into the interactive documentation (there's a static version, too). You can download chroma.min.js or use the hosted version on

You can use it in node.js, too!

npm install chroma-js

Or you can use it in SASS using chromatic-sass!

Build instructions

To compile the coffee-script source files you have to run (might have to npm install first)


To run the tests simply run

npm test

And to update the documentation (thanks!), just do

npm install --global markdown-to-html http-server
cd docs/
make && make preview

Similar Libraries / Prior Art


Chroma.js is written by Gregor Aisch.


Released under BSD license. Versions prior to 0.4 were released under GPL.

Further reading


There have been no commits in X weeks. Is chroma.js dead?

No! It's just that the author of this library has other things to do than devoting every week of his life to making cosmetic changes to a piece of software that is working just fine as it is, just so that people like you don't feel like it's abandoned and left alone in this world to die. Bugs will be fixed. Some new things will come at some point. Patience.

chroma.js open issues Ask a question     (View All Issues)
  • about 3 years is there any method to contrast with a given color
  • about 3 years What are the input ranges for LCH?
  • about 3 years Question: how did license switch from GPL to BSD happen?
  • about 3 years The in `_input.rgb` will make the rgb value become unsafe when people overwrite the Array.prototype
  • over 3 years Add CMY color space
  • over 3 years Last number in limit is smaller than the rest
  • over 3 years Feature Proposal: Get domain value from color
  • over 3 years Lab -> RGB returns negative zero
  • over 3 years Hue direction of linear interpolation in lch .
  • over 3 years uncaught typeError: r(...)[h] is not a function
  • over 3 years Generate colors based on unique values
  • over 3 years Cubehelix breaks when both lightness values are the same
  • over 3 years Quantiles broken on scale domains
  • almost 4 years Proposal: make Chroma.js immutable
  • about 4 years HCG color space
  • about 4 years Property to check if color is clipped or not
  • about 4 years Docs: Bounds of LCH
  • about 4 years Unit Tests for Converters
  • over 4 years Implement VIRIDIS colormap
  • almost 5 years using chroma-js for some colour experiments
  • almost 5 years Feature: get color at given contrast
  • about 5 years HSP color model
chroma.js open pull requests (View All Pulls)
  • HCG color space (based on HSV code)
  • Support case-insensitive colorbrewer lookups
  • Feature #36 HSP color space, and color.brightness()
  • Add viridis color map. Fix #76
  • Fixed typo
  • Corrects green test
  • Added flowtype declarations
  • Ability to call seedrandom to seed the random method
  • Changed scale() to not fail silently when out is invalid
  • fix(average): hue was averaged incorrectly
chroma.js list of languages used
chroma.js latest release notes
1.3.5 chroma 1.3.5
  • added LRGB interpolation
v1.3.3 chroma 1.3.3
  • bugfix in chroma.limits quantiles
  • bugfix when running scale.colors(1)
  • bugfix in hsi2rgb color conversion
  • added unit tests for color conversions
v1.3.1 chroma 1.3.1
Other projects in CoffeeScript