createCanvas(windowWidth, windowHeight);
rotate(frameCount / 20.0);
flower(0, 0, 70, 200, 6, 8, "DeepPink", "LightPink")
flowerCenter ("MediumBlue", "DodgerBlue", 1, 1);
rotate(frameCount / 5.0);
flower(0, 0, 50, 130, 8, 18, "yellow", "Chartreuse");
flowerCenter ("tomato", "tomato", 1, 1);
rotate(frameCount / 30.0);
flower(0, 0, 70, 150, 10, 28, "LightCyan", "MediumSlateBlue")
flowerCenter ("Indigo", "Indigo", 1, 1);
size = size+sizeIncrement;
if(size>5) sizeIncrement = -sizeIncrement;
if(size<60) sizeIncrement = -sizeIncrement;
function flower(x, y, radius1, radius2, npoints, tilt, fcolor, scolor) {
let angle = TWO_PI / npoints;
let halfAngle = angle / tilt;
for (let a = 0; a < TWO_PI; a += angle) {
let sx = x + cos(a) * radius2;
let sy = y + sin(a) * radius2;
sx = x + cos(a + halfAngle) * radius1;
sy = y + sin(a + halfAngle) * radius1;
function flowerCenter(ccolor, cstroke, cwidth, cheight){
ellipse(0, 0,cwidth, cheight);