PyDocs

Nav

Graphical user interfaces with Tk

colormode

turtle

function
  • colormode(cmode=None)
Return the colormode or set it to 1.0 or 255. After setting it, the r, g and b values of color triples have to be between 0 and cmode.
1 Example
>>> screen.colormode(1)
>>> turtle.pencolor(240, 160, 80)
Traceback (most recent call last):
     ...
TurtleGraphicsError: bad color sequence: (240, 160, 80)
>>> screen.colormode()
1.0
>>> screen.colormode(255)
>>> screen.colormode()
255
>>> turtle.pencolor(240,160,80)
from the Python docs
See Also
No see-alsos for turtle/colormode
0 Notes
No notes for colormode