xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100);
background(0);
}
function draw() {
let location = createVector(random(width), random(height));
let numPetal = int(random(4, 18));
let radius = random(width / 120, width / 80);
flower(location, numPetal, radius);
}
function flower(location, numPetal, radius) {
stroke(0, 0, 50, 30);
fill(random(360), 20, 100, 90);
push();
translate(location.x, location.y);
for (let i = 0; i < numPetal; i++) {
push();
rotate(2 * PI / numPetal * i);
circle(radius, 0, radius);
pop();
}
fill(60, 1000, 100);
circle(0, 0, radius * 1.2);
pop();
}