This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained. [More info]
There are two general ways to specify colors in Tkinter.
You can use a string specifying the proportion of red, green, and blue in hexadecimal digits:
#rgb | Four bits per color |
#rrggbb | Eight bits per color |
#rrrgggbbb | Twelve bits per color |
For example, '#fff'
is white, '#000000'
is black, '#000fff000'
is pure green, and '#00ffff'
is pure cyan (green plus blue).
You can also use any locally defined standard
color name. The colors
'white'
,
'black'
,
'red'
,
'green'
,
'blue'
,
'cyan'
,
'yellow'
, and
'magenta'
will always be
available. Other names may work, depending on your
local installation.