faqts : Computers : Programming : Languages : Python : Tkinter

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

9 of 9 people (100%) answered Yes
Recently 8 of 8 people (100%) answered Yes

Entry

What is the name of the file that contains the color definitions for Tkinter (like 'rosy brown', etc.)?

Aug 16th, 2000 00:57
unknown unknown, Dan Kuchler


I don't think you'll find them anyway in the code, I believe they are an
internal tcl/tk thing, ( although I think the colour names are X
related). In your tools folder you'll find a little application called
pynche which allows you to select colours and it returns the nearest Tk
colour by name. There is a file in there called namedcolors.txt which
lists the colours.
------------------
You'll find the colors defined in tk8.0.n/xlib/X11/xcolors.c.
You can also find a little Python program in the examples for my book 
which displays all the colors. You can find it in the utils subdirectory 
as colors.py You don't have to buy the book to get the examples...
   www.manning.com/Grayson
-----------------
Just for completeness, I think the best place to get the color 
definitions is from the Tk man pages.  The newer releases (Tk 8.4a1 and 
Tk 8.3.2) have a 'colors' manual page which lists all of the color names 
and the associated RGB values.
The manual pages for all versions of tk are online at:
http://dev.scriptics.com/man/
and for this particular question, the web page that lists the colors is:
http://dev.scriptics.com/man/tcl8.3.2/TkCmd/colors.htm