ColorMix

The color mixing open source library

v2.0.0

What is ColorMix.js ?

A javascript library for mixing, blending and easily manipulating colors and color spaces [Hex, RGB, XYZ, HSL, Lab].

The mixing methods are using the Lab color space.
This color space is designed to approximate the human vision, that's why a Lab mix is closer to our vision than a RGB mix.

It means that your colors will first be converted to this schema, what can be a bit heavy / slow if you use it inside an interval as requestAnimationFrame.

Okay, and technically ?

ColorMix is a global JS singleton object, so accessible from anywhere.
It contains some direct methods to mix several colors, get and set up a custom colors gradient, and blend a reference in this gradient.
It contains also two subclasses:

  • ColorMix.Color() - A class to easily manipulating colors
  • ColorMix.ColorSpace - A singleton to convert colors into different color spaces.

Read the documentation for more informations !

Is it free ?

Sure! And open-sourced on GitHub. Feel free to star or fork. Pull-requests are welcome!

Do you find it usefull (or expected more from it) ?

Just send me your feedbacks!