xxxxxxxxxx
54
function setup() {
createCanvas(400, 400);
frameRate(10);
}
function draw() {
let y = color(255, 255, 119);
let bl = color(171, 255, 255);
let gr = color(144, 251, 120);
let br = color(94, 25, 0);
let r = color(248, 40, 22);
let p = color(96, 35, 250);
let arraycolors = [y, bl,gr, r, p, br];
if(keyIsPressed){
background(12,55,100);
for(let i = 0; i<width; i += 10){
for(let j = 15; j< height; j+= 60){;
fill(bl,0);
frameRate(7);
strokeWeight(random(3));
ellipse(i, j, random(30),random(30));
ellipse(i, j, random(10))
}
}
}else{
strokeWeight(1);
background(12,55,100);
frameRate(10);
for(let i = 15; i<width; i += 10){
for(let j = 15; j< height; j+= 60){
if (mouseX>0 && mouseX < width && mouseY>0 && mouseY < height){
let f = int(random(5));
fill(arraycolors[f]);
}else{
fill(bl);
}
ellipse(i, random(j), random(7));
}
}
}
}