I am trying to set the background color of my turtle graphic, is there a way can set the background color for python turtle?
Pen Color and Screen Color You can change the color of the lines that the turtle draws with the SETPENCOLOR command. You can change the color of the screen (or background) with the SETSCREENCOLOR command. Sets the color that the turtle draws to green.
colormode() This function is used to return the color mode or set it to 1.0 or 255. (r, g, b) values of color triples have to be in range 0 to c mode.
Use turtle.bgcolor(*args)
.
For instance:
import turtle
turtle.bgcolor("black")
or
from turtle import *
bgcolor("black")
Read the documentation at http://docs.python.org/library/turtle.html#turtle.bgcolor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With