This file contains hidden or 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
function getAvColor (img) { | |
var canvas = document.createElement('canvas'), | |
context = canvas.getContext && canvas.getContext('2d'), | |
rgb, | |
pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel | |
count = 0, | |
data, length, | |
i = -4; | |
// return the base colour for non-compliant browsers |