Follow the below steps to draw filled shape with the desired color-
fillcolor()
function and pass the color name or color in the #RRGGBB format.begin_fill()
and then start drawing using Turtle functions. Once you are done with the drawing, call end_fill()
function to fill the drawn figure with the selected color.#Python program to draw color filled square in turtle programming import turtle t = turtle.Turtle() t.fillcolor('blue') t.begin_fill() for i in range(4): t.forward(150) t.right(90) t.end_fill()
Output of the above program
#Python program to draw color filled triangle in turtle programming import turtle t = turtle.Turtle() t.fillcolor('#FFA500') t.begin_fill() for i in range(4): t.forward(150) t.right(-120) t.end_fill()
Output of the above program
#Python program to draw color filled star in turtle programming import turtle t = turtle.Turtle() t.fillcolor('orange') t.begin_fill() for i in range(5): t.forward(150) t.right(144) t.end_fill()
Output of the above program
#Python program to draw color filled hexagon in turtle programming import turtle t = turtle.Turtle() t.fillcolor('orange') t.begin_fill() for i in range(6): t.forward(150) t.right(60) t.end_fill()
Output of the above program
#Python program to draw color filled circle in turtle programming import turtle t = turtle.Turtle() t.fillcolor('orange') t.begin_fill() t.circle(100) t.end_fill()
Output of the above program