xxxxxxxxxx
34
//ball color
let r = 0;
let g = 0;
let b = 0;
let ballsize = 255;
//background color
let backR = 0;
let backG = 0;
let backB = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(backR, backG, backB);
fill(r,g,b);
ellipse(width/2, height/2, ballsize, ballsize);
if (mouseIsPressed) {
backR = random(255);
backG = random(255);
backB = random(255);
}
}
function mousePressed() {
r=random(255);
g=random(255);
b=random(255);
}