Prerequisite: Python Turtle Basics
turtle is an inbuilt module in python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle. To move turtle, there are some functions i.e
To fill the colors in the shapes drawn by turtle, turtle provides three functions –
fillcolor(): This helps to choose the color for filling the shape. It takes the input parameter as the color name or hex value of the color and fills the upcoming closed geographical objects with the chosen color. Color names are basic color names i.e. red, blue, green, orange.
The hex value of color is a string(starting with ‘#’) of hexadecimal numbers i.e. #RRGGBB. R, G, and B are the hexadecimal numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F).
begin_fill(): This function tells turtle that all upcoming closed graphical objects needed to be filled by the chosen color.
end_fill(): this function tells turtle to stop the filling upcoming closed graphical objects.
Drawing Color Filled Square:
Drawing Color Filled Triangle:
Drawing Color Filled Hexagon:
Drawing Color Filled Star:
Drawing Color Filled Circle:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- How to draw color filled star in Python-Turtle?
- How to Create custom Turtle shapes in Python?
- Draw geometric shapes on images using OpenCV
- Draw Circle in Python using Turtle
- Draw Square and Rectangle in Turtle - Python
- Draw any polygon in Turtle - Python
- Draw Colourful Star Pattern in Turtle - Python
- Draw Cube and Cuboid in Python using Turtle
- Draw Shape inside Shape in Python Using Turtle
- Draw Colored Solid Cube using Turtle in Python
- Draw Panda Using Turtle Graphics in Python
- Draw Heart Using Turtle Graphics in Python
- Draw Ellipse Using Turtle in Python
- Draw Graph Grid Using Turtle in Python
- Draw Dot Patterns Using Turtle in Python
- Draw Chess Board Using Turtle in Python
- Draw Spiraling Star using Turtle in Python
- Draw Spiraling Polygon using Turtle in Python
- Draw Spiraling Square using Turtle in Python
- Draw Spiraling Triangle using Turtle in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.