October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Python Turtle Colors: Names, RGB, Hex, and colormode

Python Turtle accepts Tk color names and hex strings plus numeric RGB. Learn when to use normalized channels or colormode(255), which color function to choose, and where Tk lists its named colors.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Python Turtle accepts Tk color names and hex strings, as well as numeric RGB values. Numeric channels must match the active color mode: Turtle defaults to normalized values from 0 to 1, or you can call turtle.colormode(255) to use 8-bit values from 0 to 255. The complete named-color reference comes from Tk, not from a separate Turtle color list.

Python Turtle colors list: where to find the full list

Turtle color names are Tk color specifications. For the authoritative names and their 8-bit RGB values, use the Tk 9.0.2 color manual. It includes names in forms such as alice blue and AliceBlue, along with numbered variants such as aquamarine1 through aquamarine4. This is the Tk 9.0 reference; the names available to a program depend on the Tk version in its environment.

Python’s Turtle reference describes color strings as Tk color specifications and gives examples including "red" and "#33cc8c". See the Python 3.15.0rc3 Turtle documentation for the API details. Because that Python page is for a release candidate, check the stable Python documentation for the version you are using if version-specific behavior matters.

How do I use RGB colors in Turtle?

Choose the channel scale first. The default color mode is 1.0, which uses normalized channel values from 0 to 1. To use the familiar 8-bit RGB scale from 0 to 255, set the mode to 255 before passing the RGB values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import turtle

turtle.colormode(255)
turtle.pencolor(240, 160, 80)

You can supply RGB as a tuple as well. In normalized mode, for example, (0.2, 0.8, 0.55) is valid; in 255 mode, a value such as (50, 193, 143) uses 8-bit channels. Do not pass values like (240, 160, 80) while still in the default 1.0 mode: values outside the active range raise TurtleGraphicsError.

import turtle

turtle.colormode(1.0)
turtle.pencolor(0.2, 0.8, 0.55)

The supported input forms and numeric range behavior are documented in the Turtle color API reference and colormode documentation.

How do I set a hex color in Python Turtle?

Pass a Tk hex color string to a Turtle color function. For example, "#33cc8c" is a valid color specification. Hex strings state the color directly, while a name such as "red" is easier to read; both string forms follow Tk’s color specification rules.

import turtle

turtle.pencolor("#33cc8c")
turtle.fillcolor("#a0c8f0")

Which Turtle color function should I use?

Function What it changes Example
pencolor Pen color, including polygon outlines turtle.pencolor("red")
fillcolor Interior color used when filling a polygon turtle.fillcolor("#33cc8c")
color Both pen and fill when given one color; separate pen and fill colors when given two turtle.color("red", "#a0c8f0")
bgcolor Screen background turtle.bgcolor("black")

Here is the same set of roles in one short example:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import turtle

turtle.colormode(255)
turtle.pencolor(240, 160, 80)
turtle.fillcolor("#33cc8c")
turtle.color("red", "#a0c8f0")
turtle.bgcolor("black")

When color receives one color, it sets pen and fill together; when it receives separate pen and fill colors, it assigns them independently. Use pencolor or fillcolor when you only want to change one role.

What does turtle.colormode(255) do?

turtle.colormode(255) changes how Turtle interprets numeric RGB channels, allowing each channel to use the 0–255 scale. The documented alternatives are 1.0 (the default, for values from 0 to 1) and 255. This setting affects numeric RGB input; color names and Tk hex strings remain string specifications.

Set the mode before passing numeric channels so the values you provide fit the selected range. A mode mismatch is a common cause of TurtleGraphicsError.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What if Turtle will not start?

Turtle graphics depends on tkinter. Python’s documentation notes that some Linux distributions and other platforms package the optional Tk interface separately. If importing or launching Turtle fails before you reach color code, check whether Tk support is installed for your Python environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.