coex is a library that helps you extract the most common colors of an image in the browser.
- Usage of the median-cut algorithm.
- Find contrast colors.
AMD
compatible
$ npm install coex
import Coex from 'coex';
const coex = new Coex(path/to/image);
coex.get(function (err, colors) {
if (err) {
throw err;
}
console.log(colors);
const contrastColor = coex.getContrastColor(colors);
console.log(contrastColor);
coex.destroy();
});
All browsers that supports HTML5.
Released under the MIT License.