chroma.js is a small-ish zero-dependency JavaScript library (13.5kB) for all kinds of color conversions and color scales. Read colors from a wide range of formats, analyze and manipulate colors, convert colors into wide range of formats, linear and bezier interpolation in different color spaces. Aside from that, chroma.js can also help you generate nice colors using various methods, for instance to be used in color palette for maps or data visualization. The first step is to get your color into chroma.js. That's what the generic constructor chroma() does. This function attempts to guess the format of the input color for you. For instance, it will recognize any named color from the W3CX11 specification. If there's no matching named color, chroma.js checks for a hexadecimal string. It ignores case, the # sign is optional, and it can recognize the shorter three letter format as well. So, any of these are valid hexadecimal representations: #ff3399, FF3399, #f39, etc.

Features

  • Get and set the color opacity using color.alpha
  • Once loaded, chroma.js can change colors
  • Chroma.js allows you to output colors in various color spaces and formats
  • A color scale, created with chroma.scale, is a function that maps numeric values to a color palette
  • You can change the input domain to match your specific use case
  • Blend two colors using RGB channel-wise blend functions

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Chroma.js

Chroma.js Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Chroma.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript User Interface (UI) Software

Registered

2021-07-08