Color Thief
Grab the color palette from an image using just Javascript
.... 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.