set-canvas-pixels
v1.0.0
Published
Sets a canvas pixels from an array of RGBA pixel values
Downloads
74
Readme
set-canvas-pixels
Sets a canvas pixels from an array of RGBA pixel values
Sets the pixels of a canvas from an array of RGBA values between 0 and 255.
Install
$ npm install set-canvas-pixels
Usage
var setCanvasPixels = require('set-canvas-pixels');
var pixels = [0, 0, 0, 255, 255, 255, 255, 255/*, ...*/];
var canvas = document.getElementById('canvas');
setCanvasPixels(canvas, pixels);