Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way can set the background color for python turtle?

I am trying to set the background color of my turtle graphic, is there a way can set the background color for python turtle?

like image 476
phhnk Avatar asked Apr 28 '11 03:04

phhnk


People also ask

Which command will help to change the background Colour of the 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.

How do I change my turtle color mode?

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.


1 Answers

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

like image 89
Drew Avatar answered Jan 26 '23 21:01

Drew