OpenTechSchool / python-beginners

Workshop material for "Introduction to Programming with Python"
http://opentechschool.github.io/python-beginners/
175 stars 253 forks source link

Setting RGB colors is weird #35

Closed metaodi closed 8 years ago

metaodi commented 11 years ago

When playing around with turtle a participant wanted to use RGB colors as described on the turtle page. He was used to enter RGB as 3 values from 0-255. It is not very clear how to do this, he always got this:

TurtleGraphicsError: bad color sequence: (255, 40, 5)

An example might help. To get it to work, you have to change the color mode of the turtle, then it works:

turtle.colormode(255)
turtle.color(255, 40, 5)

See also the turtle documentation about colormode().

lpatmo commented 9 years ago

Thanks!

AnteDieEnte commented 3 years ago

Thank you so much!