size(200, 300);
//draw green stem
strokeWeight(10);
stroke(0, 128, 0);
line(100, 100, 100, 300);
//leafs
ellipse(105, 200, 10, 10);
ellipse(95, 225, 10, 10);
//change stroke back to thin black line
strokeWeight(1);
stroke(0);
//draw petals
fill(255, 100, 0);
ellipse(50, 50, 100, 100);
ellipse(150, 50, 100, 100);
ellipse(50, 150, 100, 100);
ellipse(150, 150, 100, 100);
//draw middle part
fill(255, 128, 0);
ellipse(100, 100, 100, 100);
This code calls a series of functions do draw a flower:
See the Pen by Happy Coding (@KevinWorkman) on CodePen.
This example calls functions to draw a flower.
Happy Coding is a community of folks just like you learning about coding.
Do you have a comment or question? Post it here!
Comments are powered by the Happy Coding forum. This page has a corresponding forum post, and replies to that post show up as comments here. Click the button above to go to the forum to post a comment!