let frequencyOfWhite = 0.618;
let topLeftToBottomRight = true;
colorMode(HSB, 360, 100, 100, 100);
background(0, 0, 100, 100);
if (frameCountValue % 60 == 0) {
firstColor = randomColor(frequencyOfWhite);
secondColor = randomColor(frequencyOfWhite);
delta = 2 + 5 * random(1);
crossPoint = createVector(random(width), random(height));
topLeftToBottomRight = !topLeftToBottomRight;
if(topLeftToBottomRight) {
rect(0, 0, crossPoint.x, crossPoint.y);
rect(crossPoint.x, crossPoint.y, width, height);
rect(crossPoint.x, 0, width, crossPoint.y);
rect(0, crossPoint.y, crossPoint.x, height);
cross(crossPoint, delta);
function randomColor(frequencyOfWhite) {
let pallet = [0,10, 30,40, 320,330,350];
if(random(1) > frequencyOfWhite) {
return color(pallet[int(random(7))], 100, 100, 2);
return color(0, 0, 100, 5);
function cross(crossPoint, thickness) {
line(0, crossPoint.y, width, crossPoint.y);
line(crossPoint.x, 0, crossPoint.x, height);