xxxxxxxxxx
53
let count;
let col = ["#fcba03", "#fc033d", "#03fcca"];
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(1);
}
function draw() {
background(0);
generative();
}
function shape(x, y, size) {
noFill();
strokeWeight(2);
circle(x, y, size);
strokeWeight(3);
beginShape();
vertex(x - size, y);
vertex(x - size / 2, y + size);
vertex(x + size / 2, y + size);
vertex(x + size, y);
vertex(x + size / 2, y - size);
vertex(x - size / 2, y - size);
vertex(x - size, y);
endShape();
strokeWeight(2);
circle(x, y, size / 2);
}
function generative() {
count = floor(random(0, 3));
for (let x = 0; x <= width; x += 80) {
for (let y = 0; y <= height; y += 80) {
let generate = random(0.3);
if (generate > 0 && generate < 0.1) {
stroke(col[count]);
shape(x, y, 40);
} else if (generate > 0.1 && generate < 0.2) {
stroke(col[1]);
shape(x, y, 20);
} else if (generate > 0.2 && generate < 0.3) {
stroke(col[2]);
shape(x, y, 60);
}
}
}
}