Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thibauts/set-canvas-pixels

Sets a canvas pixels from an array of RGBA pixel values
https://github.com/thibauts/set-canvas-pixels

Last synced: 21 days ago
JSON representation

Sets a canvas pixels from an array of RGBA pixel values

Awesome Lists containing this project

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
-------

```bash
$ npm install set-canvas-pixels
```

Usage
-----

```javascript
var setCanvasPixels = require('set-canvas-pixels');

var pixels = [0, 0, 0, 255, 255, 255, 255, 255/*, ...*/];

var canvas = document.getElementById('canvas');
setCanvasPixels(canvas, pixels);
```