r=0
g=0
b=0
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
if (mouseIsPressed){
r=random(255);
g=random(255);
b=random(255);
}
else{
r=0
g=0;
b=0;
}
c(100,100,r,g,b);
c(200,200,r,g,b);
c(100,200,r,g,b);
c(200,100,r,g,b);
}
function c(x,y){
noFill();
stroke(r,g,b);
ellipse(x+25,y+25,100);
fill(r,g,b);
if (mouseX less than x){
ellipse(x,y+25,5);
ellipse(x+25,y+25,5);
line(x,y+35,x+25,y+35);
}
else {
ellipse(x+25,y+25,5);
ellipse(x+50,y+25,5);
line(x+25,y+35,x+50,y+35);
}
}