Skip to content

Instantly share code, notes, and snippets.

View 404Assassin's full-sized avatar

Christian Worley 404Assassin

  • Portland, Oregon, USA
View GitHub Profile
@404Assassin
404Assassin / average-color.js
Last active April 12, 2016 22:00 — forked from fuzzyfox/average-color.js
JavaScript: image average color
var getAverageColor = (function(window, document, undefined){
return function(imageURL, options}){
options = {
// image split into blocks of x pixels wide, 1 high
blocksize: options.blocksize || 5,
fallbackColor: options.fallbackColor || '#000'
};
var img = document.createElement('img'),
canvas = document.createElement('canvas'),