Created
April 19, 2016 15:12
-
-
Save nick3499/1de6f156f8a3225b107802363c41ea89 to your computer and use it in GitHub Desktop.
Load Pixels. Using p5.js library.
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 setup () { | |
| createCanvas(1152, 648); | |
| background(0); | |
| } | |
| function draw () { | |
| loadPixels(); | |
| var d = pixelDensity(); | |
| var t = 4 * (width * d) * (height * d); | |
| for (var i = 0; i < t; i += 4) { | |
| pixels[i + 0] = random(85, 255); // red | |
| pixels[i + 1] = 0; // green | |
| pixels[i + 2] = 0; // blue | |
| pixels[i + 3] = 255; // alpha | |
| } | |
| updatePixels(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment