nick34992
4/19/2016 - 3:12 PM

Load Pixels. Using p5.js library.

Load Pixels. Using p5.js library.

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();
}