HomeTurtlegraficsGPanelRobotics WebTigerPython |
Python - Online |
Deutsch English |
YOU LEARN HERE... |
some more Turtle commands with which you can draw colored pictures. The turtle graphic uses the so-called X11 colors On the website w3schools.com/colors/colors_x11.asp you will find 140 colors that you can use in your Turtle graphics programs (e.g. yellow, gold, orange, red, maroon, violet, magenta, purple, navy, blue, skyblue, cyan, turquoise, lime, green, darkgreen, chocolate, brown, black, gray, white....). |
EXAMPLE |
Program: from gturtle import * makeTurtle() setPenWidth(60) setPenColor("red") forward(100) penUp() forward(50) penDown() setPenColor("yellow") dot(40) setPenWidth(5) setPenColor("black") back(15) hideTurtle() |
REMEMBER... |
Use setPenColor(“color”) to change the pen color. Use setColor(“color”) to change the turtle color. On the website w3schools.com/colors/colors_x11.asp you will find many other colors that you can use as pen and turtle colors. The color names are not case-sensitive, but they must be enclosed in quotation marks. The # character is used in Python for comments. You can use it to insert comments that are not taken into account when the program is executed. |
TO SOLVE BY YOURSELF |
|
![]() |
![]() |
![]() |