Created
October 16, 2015 07:42
-
-
Save ankion/1cfa7f0487fdc765b4e6 to your computer and use it in GitHub Desktop.
color-thief example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var img = new Image(); | |
img.onload = function () { | |
var colorThief = new ColorThief(); | |
var color = colorThief.getPalette(img, 8, 5) | |
console.log('color:' + color); | |
}; | |
img.crossOrigin = 'Anonymous'; | |
img.src = src; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment