color-thief-browser
Advanced tools
Weekly downloads
Readme
#Color Thief
A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.
See a Demo | Read more on my blog
##How to use
###Get the dominant color from an image
var colorThief = new ColorThief();
colorThief.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.
var colorThief = new ColorThief();
colorThief.getPalette(sourceImage, 8);
getPalette(sourceImage[, colorCount, quality])
returns [ [num, num, num], [num, num, num], ... ]
FAQs
Get the dominant color or color palette from an image (Browser version).
The npm package color-thief-browser receives a total of 489 weekly downloads. As such, color-thief-browser popularity was classified as not popular.
We found that color-thief-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.