Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Last active February 15, 2019 18:11
Show Gist options
  • Select an option

  • Save n1ckfg/e2f8cc8d451c587cce63784ab1e3e30a to your computer and use it in GitHub Desktop.

Select an option

Save n1ckfg/e2f8cc8d451c587cce63784ab1e3e30a to your computer and use it in GitHub Desktop.
"use strict";
let x = 250;
let y = 250;
function setup() {
createCanvas(500, 500);
noStroke();
}
function draw() {
background(0, 0, 255);
fill(0);
ellipse(x, y+10, 100, 100);
loadPixels();
for (let i=0; i<pixels.length; i+=4) {
if (i % parseInt(random(32, 64)) === 0 || i % 64 === 0) {
pixels[i] = 255; // red
pixels[i+1] = 127; // green
pixels[i+2] = 0; // blue
pixels[i+3] = 255; // alpha
}
}
updatePixels();
fill(0, 255, 0);
ellipse(x, y, 100, 100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment