Describe the Color database files

This commit is contained in:
Barry Warsaw 1999-04-26 23:46:25 +00:00
parent 6e7f6ea756
commit 821d8b73e8
1 changed files with 57 additions and 30 deletions

View File

@ -2,7 +2,7 @@ Pynche - The PYthonically Natural Color and Hue Editor
Contact: Barry A. Warsaw Contact: Barry A. Warsaw
Email: bwarsaw@python.org Email: bwarsaw@python.org
Version: 0.1 Version: 1.0
Introduction Introduction
@ -16,19 +16,21 @@ Introduction
changed the name because these days, too many other systems have changed the name because these days, too many other systems have
the acronym `ICE'. the acronym `ICE'.
Pynche has been tested with Python 1.5.1 using Tk 8.0. It Pynche has been tested with Python 1.5.x using Tk 8.0.x. It
probably works with Python 1.5. I've tested it on both Solaris probably works with Python 1.5. I've tested it on both Solaris
2.6 and Windows NT. There are some funky things that happen on 2.6 and Windows NT. There are some funky things that happen on
Windows but I think they are primarily Tk problems. You'll want Windows but I think they are primarily Tk problems. You'll want
to be sure to have Tk 8.0.3 for Windows. Also, Pynche is very to be sure to have at least Tk 8.0.3 for Windows. Also, Pynche is
colormap intensive, so it doesn't work very well on 8-bit graphics very colormap intensive, so it doesn't work very well on 8-bit
cards. I'll probably fix that in the future. graphics cards. I'll probably fix that in the future.
Pynche must find a text database of colors, in the X11 format. Pynche must find a text database of colors names in order to
Pynche is distributed with an rgb.txt file from the X11R6.4 provide `nearest' color matching. Pynche is distributed with an
distribution for this reason, but you can use a different file rgb.txt file from the X11R6.4 distribution for this reason, along
with the -d option. The file xlicense.txt contains the license with other "Web related" database (see below). You can use a
only for rgb.txt and both files are in the X/ subdirectory. different file with the -d option. The file xlicense.txt contains
the license only for rgb.txt and both files are in the X/
subdirectory.
Pynche is pronounced `Pinch-ee'. Pynche is pronounced `Pinch-ee'.
@ -41,8 +43,7 @@ Running Standalone
--database file --database file
-d file -d file
Alternate location of the color database file. Without this Alternate location of the color database file. Without this
option, the first of /usr/openwin/lib/rgb.txt or X/rgb.txt option, the first valid file found will be used (see below).
will be used.
--initfile file --initfile file
-i file -i file
@ -68,10 +69,12 @@ Running Standalone
Running as a Modal Dialog Running as a Modal Dialog
Pynche can be run as a modal dialog, inside another application. Pynche can be run as a modal dialog, inside another application,
It supports the API implemented by the Tkinter standard say as a general color chooser. In fact, Grail 0.6 already uses
tkColorChooser module, with a few changes. By importing Pynche and a future version of IDLE may as well. Pynche supports
pyColorChooser from the Pynche package, you can run the API implemented by the Tkinter standard tkColorChooser module,
with a few changes as described below. By importing pyColorChooser
from the Pynche package, you can run
pyColorChooser.askcolor() pyColorChooser.askcolor()
@ -79,8 +82,9 @@ Running as a Modal Dialog
color. color.
There are some UI differences when running as a modal There are some UI differences when running as a modal
vs. standalone. When running as a modal, there is no "File" menu, vs. standalone. When running as a modal, there is no "Quit" menu
but instead there are "Okay" and "Cancel" buttons. item under the "File" menu. Instead there are "Okay" and "Cancel"
buttons.
When "Okay" is hit, askcolor() returns the tuple When "Okay" is hit, askcolor() returns the tuple
@ -148,6 +152,9 @@ The Colorstrip Window
be slower). Click on "Hexadecimal" to display the arrow numbers be slower). Click on "Hexadecimal" to display the arrow numbers
in hex. in hex.
There are also two shortcut buttons in this window, which
auto-select Black (0/0/0) and White (255/255/255).
The Proof Window The Proof Window
In the lower left corner of the main window you see two larger In the lower left corner of the main window you see two larger
@ -164,7 +171,7 @@ The Proof Window
RGB value. In that case, the first one found in the text database RGB value. In that case, the first one found in the text database
is designated the "primary" name, and this is shown under the is designated the "primary" name, and this is shown under the
Nearest chip. The other names are "aliases" and they are visible Nearest chip. The other names are "aliases" and they are visible
in other Pynche windows. in the Color List Window (see below).
The Type-in Window The Type-in Window
@ -210,15 +217,15 @@ The Text Window
The Color List Window The Color List Window
The "Color List" window shows every color in the text database The "Color List" window shows every named color in the color name
(this window may take a while to come up). In the upper part of database (this window may take a while to come up). In the upper
the window you see a scrolling list of all the color names in the part of the window you see a scrolling list of all the color names
database, in alphabetical order. Click on any color to select it. in the database, in alphabetical order. Click on any color to
In the bottom part of the window is displayed any aliases for the select it. In the bottom part of the window is displayed any
selected color (those color names that have the same RGB value, aliases for the selected color (those color names that have the
but were found later in the text database). For example, find the same RGB value, but were found later in the text database). For
color "Black" and you'll see that its aliases are "gray0" and example, find the color "Black" and you'll see that its aliases
"grey0". are "gray0" and "grey0".
If the color has no aliases you'll see "<no aliases>" here. If you If the color has no aliases you'll see "<no aliases>" here. If you
just want to see if a color has an alias, and do not want to select a just want to see if a color has an alias, and do not want to select a
@ -258,7 +265,7 @@ The Details Window
around to the other side. Thus if red were at 238 and +25 around to the other side. Thus if red were at 238 and +25
were clicked, red would have the value 7. were clicked, red would have the value 7.
Preseve Distance Preserve Distance
When the increment or decrement would send any of the tied When the increment or decrement would send any of the tied
variations out of bounds, all tied variations are wrapped as variations out of bounds, all tied variations are wrapped as
one, so as to preserve the distance between them. Thus if one, so as to preserve the distance between them. Thus if
@ -299,7 +306,7 @@ Persistency
When Pynche exits, it saves these values in the init file, and When Pynche exits, it saves these values in the init file, and
re-reads them when it starts up. There is no locking on this re-reads them when it starts up. There is no locking on this
file, so if you run multiple instances of Pynche at a time, you file, so if you run multiple instances of Pynche at a time, you
will override the init file. may clobber the init file.
The actual options stored include The actual options stored include
@ -311,12 +318,32 @@ Persistency
insertion point, and all current text widget element color insertion point, and all current text widget element color
settings. settings.
- the name of the color database file (but not its contents)
You can inhibit Pynche from reading the init file by supplying the You can inhibit Pynche from reading the init file by supplying the
--ignore option on the command line. However, you cannot suppress --ignore option on the command line. However, you cannot suppress
the storing of the settings in the init file on Pynche exit. If the storing of the settings in the init file on Pynche exit. If
you really want to do this, use /dev/null as the init file, using you really want to do this, use /dev/null as the init file, using
--initfile. --initfile.
Color Name Database Files
Pynche uses a color name database file to calculate the nearest
color to the selected color, and to display in the Color List
view. Several files are distributed with Pynche, described
below. By default, the X11 color name database file is selected.
Other files:
html40colors.txt -- the HTML 4.0 guaranteed color names
websafe.txt -- the 216 "Web-safe" colors that Netscape and MSIE
guarantee will not be dithered. These are specified in #rrggbb
format for both values and names
webcolors.txt -- The 140 color names that Tim Peters and his
sister say NS and MSIE both understand (with some controversy over
AliceBlue).
To Do To Do
Here's a brief list of things I want to do: Here's a brief list of things I want to do: