xxxxxxxxxx
30
let petals = 6;
let r = 10;
function setup(){
createCanvas(400, 400);
}
function draw(){
background(220);
for (let x = 50; x < width; x+=100){
for (let y = 50; y < height; y+=100){
push();
translate(x, y);
drawFlower();
pop();
}
}
}
function drawFlower() {
fill(255, 0, 125);
for (let i=0; i<petals; i++){
ellipse(r*cos((TWO_PI/petals)*i), r*sin((TWO_PI/petals)*i), 20, 20);
}
fill(255, 225, 29);
ellipse(0, 0, 20, 20)
}