Not mine - Just an updated fork of Color Thief (Renamed to color-sieve)
A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.
See a Demo
Install
$ yarn add color-sieve
How to use
Get the dominant color from an image
var colorSieve = new (require('color-sieve'))();
colorSieve.getColor(sourceImage);
getColor(sourceImage[, quality])
returns {r: num, g: num, b: num}
Build a color palette from an image
In this example, we build an 8 color palette.
colorSieve.getPalette(sourceImage, 8);
getPalette(sourceImage[, colorCount, quality])
returns [ [num, num, num], [num, num, num], ... ]
Node Tests
Run the node tests via npm test
Original Author
by Lokesh Dhakar
lokeshdhakar.com
twitter.com/lokesh