xxxxxxxxxx
52
let size = 5;
let r1 = 255;
let g1 = 132;
let b1 = 232;
//127, 44, 203
let r2 = 127;
let g2 = 132;
let b2 = 232;
let colorToggle = 50;
function setup() {
createCanvas(600, 800);
noLoop();
noStroke();
}
function draw() {
background(220);
let s = size;
let xOffset = 0;
for (let x = 0;x<width;x+=size*2){
for (let y = 0; y <height;y+=size){
s += random(-1,1);
s = constrain(s,1,50);
xOffset +=random(-2,2);
colorToggle +=random(-10,10);
colorToggle = constrain(colorToggle,0,100);
if(colorToggle > 80){
g1 += random(-5,5);
g1 = constrain(g1,0,255);
fill(r1,g1,b1);
}
else {
r2 += random(-5,5);
r2 = constrain(r2,100,200);
fill(r2,g2,b2);
}
circle(x+xOffset,y,s);
}
}
}