Lesson 16 of 51 · Colors & Styling
Color Modes (255 vs 1.0)
Turtle supports two color modes: 1.0 (default) and 255.
Python
from turtle import *
bgcolor("black")
colormode(1.0)
pensize(5)
color(1.0, 0.4, 0.7)
forward(100)
right(90)
color(0.3, 0.8, 1.0)
forward(100)
right(90)
color(0.9, 0.9, 0.2)
forward(100)
right(90)
color(0.4, 1.0, 0.5)
forward(100)
done()Output

1
colormode(1.0)
Colors are floats between 0 and 1: color(1.0, 0.5, 0.2).
2
colormode(255)
Colors are integers between 0 and 255: color(255, 128, 50).