1.0.0 • Published 9 years ago

avg-canvas-rgb v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

avg-canvas-rgb npm.io


This module calculates the average rgb value of a canvas.

Installation

  > npm install avg-canvas-rgb

Usage

The only argument you need to pass in is the imageData.

var avrRGB = require('avg-canvas-rgb');

console.log( avrRGB( context ) ); // [35, 34, 95]

Raison d'être

Had a fun reading on CanvasRenderingContext2D.getImageData() and there were not any module that does this calculation.

super light, no dependencies, written in ES5.

License

npm.io © Mohamed Hayibor