Color Thief
Grab the color palette from an image using just Javascript
...When run in Node, this argument expects a path to the image. quality is an optional argument that must be an Integer of value 1 or greater, and defaults to 10. The number determines how many pixels are skipped before the next one is sampled. We rarely need to sample every single pixel in the image to get good results. The bigger the number, the faster a value will be returned. Gets a palette from the image by clustering similar colors. The palette is returned as an array containing colors, each color itself an array of three integers.