[FAQTS] Python Knowledge Base Update -- August 15th, 2000

Dan Kuchler kuchler at ajubasolutions.com
Wed Aug 16 00:18:11 EDT 2000


Fiona Czuczman wrote:
> 

> -------------------------------------------------------------
> What is the name of the file that contains the color definitions for Tkinter (like 'rosy brown', etc.)?
> http://www.faqts.com/knowledge-base/view.phtml/aid/5363
> -------------------------------------------------------------
> Fiona Czuczman
> Richard Chamberlain, John Grayson
> 
> 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

--Dan



More information about the Python-list mailing list