I’d like to use Color Thief, a script which allows you to extract the dominant color of an image.
Unfortunately I’m not able to get the code to work. I’d like the dominant color to be the background color of a div called mydiv
.
Here’s what I have so far: http://jsfiddle.net/srd5y/4/
Updated code / transfered to my own server due to cross-linking issues: http://moargh.de/daten/color-thief-master/test.html
JS
var sourceImage = 'https://www.google.de/intl/de_ALL/images/logos/images_logo_lg.gif';
var colorThief = new ColorThief();
colorThief.getColor(sourceImage);
HTML
<div id="mydiv"></div>
Thanks for any help!
$(window).ready(handlerFunction)
. The color for the updated code image should be [125, 190, 193]