Skip to content

Instantly share code, notes, and snippets.

View RezaAmd's full-sized avatar
🎯
Focusing...

Reza Ahmadi RezaAmd

🎯
Focusing...
View GitHub Profile
@RezaAmd
RezaAmd / average-color.js
Created August 20, 2019 16:37 — 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'),