let proportionOfWhite= 0.382;
let topLeftToBottomRight = true;
colorMode(HSB,360,100,100,100);
if(topLeftToBottomRight) {
crossPoint = createVector(random(width),random(width));
fill(randomColor(proportionOfWhite));
rect(0,0,crossPoint.x,crossPoint.y);
fill(randomColor(proportionOfWhite));
rect(crossPoint.x,crossPoint.y,width,width);
topLeftToBottomRight = false;
crossPoint = createVector(random(width),random(width));
fill(randomColor(proportionOfWhite));
rect(crossPoint.x,0,width,crossPoint.y);
fill(randomColor(proportionOfWhite));
rect(0,crossPoint.y,crossPoint.x,width);
topLeftToBottomRight = true;
function randomColor(proportionOfWhite) {
if(random(1)>proportionOfWhite) {
return color((230+ random(190))%360,100,100,random(1)*random(100));
return color(0,0,100,random(100));
function cross(crossPoint, thickness) {
line(0,crossPoint.y,width ,crossPoint.y);
line(crossPoint.x,0, crossPoint.x ,width);