Skip to content

Instantly share code, notes, and snippets.

@edgalindo
Created November 27, 2016 19:57
Show Gist options
  • Select an option

  • Save edgalindo/a96edc6a66b457e8e0926cde8bc005d5 to your computer and use it in GitHub Desktop.

Select an option

Save edgalindo/a96edc6a66b457e8e0926cde8bc005d5 to your computer and use it in GitHub Desktop.
var x, y, a, b;
x,y = 0;
var a = 250;
var b = 250;
function setup() {
createCanvas(500, 500);
background(0);
smooth();
}
function draw() {
strokeWeight(2);
stroke(255);
noLoop();
rect(0, y, width, height/2);
stroke(0);
rectMode(CENTER);
blendMode(DIFFERENCE);
rect(width/2, height/2, a, b);
}
function mousePressed(){
save('image.jpg');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment