xxxxxxxxxx
42
//https://coolors.co/2631d3-ff7f44-39ceef-49fff5-ff7151
var div;
var cmax;
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB,360,100,100);
frameRate(60);
stroke(0,0,1000);
strokeWeight(1);
reDraw();
}
function reDraw(){
div = 5;
cmax = 8;
divide(0,0,max(width,height),0);
}
function draw() {
if(frameCount%60==0) reDraw();
}
function divide(x,y,d,c){
if(c<cmax&&random(1)<1-c/cmax*0.6){
c++;
if((cmax-c)/cmax<random(0.5)){
fill(color(random(5,30),random(60,80),100));
}else{
fill(color(random(185,240),random(70,80),90));
}
rect(x,y,d,d);
divide(x,y,d/2,c);
divide(x+d/2,y,d/2,c);
divide(x,y+d/2,d/2,c);
divide(x+d/2,y+d/2,d/2,c);
}
}
function mousePressed(){
//reDraw();
}