xxxxxxxxxx
// By Roni Kaufman
// After John Maeda
let lapse = 0; // mouse timer
function setup() {
createCanvas(1112, 834);
frameRate(1)
}
function draw() {
clear()
blendMode(DIFFERENCE);
for (let i = 0; i < 154; i++) {
let x = width/2 + random(-60, 60);
let y = height/2 + random(-60, 60);
//let d = 125 + i*3;
let d = 150 + i*i/40
if (i % 3 === 0) {
fill(255, 0, 0);
} else if (i % 3 === 1) {
fill(0, 255, 0);
} else {
fill(0, 0, 255);
}
circle(x, y, d);
}
}
function mousePressed(){
// prevents mouse press from registering twice
if (millis() - lapse > 500){
save('pix.jpg');
lapse = millis();
}
}