Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 821d8b7

Browse files
committed
Describe the Color database files
1 parent 6e7f6ea commit 821d8b7

1 file changed

Lines changed: 58 additions & 31 deletions

File tree

Tools/pynche/README

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pynche - The PYthonically Natural Color and Hue Editor
22

33
Contact: Barry A. Warsaw
44
5-
Version: 0.1
5+
Version: 1.0
66

77
Introduction
88

@@ -16,19 +16,21 @@ Introduction
1616
changed the name because these days, too many other systems have
1717
the acronym `ICE'.
1818

19-
Pynche has been tested with Python 1.5.1 using Tk 8.0. It
19+
Pynche has been tested with Python 1.5.x using Tk 8.0.x. It
2020
probably works with Python 1.5. I've tested it on both Solaris
2121
2.6 and Windows NT. There are some funky things that happen on
2222
Windows but I think they are primarily Tk problems. You'll want
23-
to be sure to have Tk 8.0.3 for Windows. Also, Pynche is very
24-
colormap intensive, so it doesn't work very well on 8-bit graphics
25-
cards. I'll probably fix that in the future.
26-
27-
Pynche must find a text database of colors, in the X11 format.
28-
Pynche is distributed with an rgb.txt file from the X11R6.4
29-
distribution for this reason, but you can use a different file
30-
with the -d option. The file xlicense.txt contains the license
31-
only for rgb.txt and both files are in the X/ subdirectory.
23+
to be sure to have at least Tk 8.0.3 for Windows. Also, Pynche is
24+
very colormap intensive, so it doesn't work very well on 8-bit
25+
graphics cards. I'll probably fix that in the future.
26+
27+
Pynche must find a text database of colors names in order to
28+
provide `nearest' color matching. Pynche is distributed with an
29+
rgb.txt file from the X11R6.4 distribution for this reason, along
30+
with other "Web related" database (see below). You can use a
31+
different file with the -d option. The file xlicense.txt contains
32+
the license only for rgb.txt and both files are in the X/
33+
subdirectory.
3234

3335
Pynche is pronounced `Pinch-ee'.
3436

@@ -41,8 +43,7 @@ Running Standalone
4143
--database file
4244
-d file
4345
Alternate location of the color database file. Without this
44-
option, the first of /usr/openwin/lib/rgb.txt or X/rgb.txt
45-
will be used.
46+
option, the first valid file found will be used (see below).
4647

4748
--initfile file
4849
-i file
@@ -68,19 +69,22 @@ Running Standalone
6869

6970
Running as a Modal Dialog
7071

71-
Pynche can be run as a modal dialog, inside another application.
72-
It supports the API implemented by the Tkinter standard
73-
tkColorChooser module, with a few changes. By importing
74-
pyColorChooser from the Pynche package, you can run
72+
Pynche can be run as a modal dialog, inside another application,
73+
say as a general color chooser. In fact, Grail 0.6 already uses
74+
Pynche and a future version of IDLE may as well. Pynche supports
75+
the API implemented by the Tkinter standard tkColorChooser module,
76+
with a few changes as described below. By importing pyColorChooser
77+
from the Pynche package, you can run
7578

7679
pyColorChooser.askcolor()
7780

7881
which will popup Pynche as a modal dialog, and return the selected
7982
color.
8083

8184
There are some UI differences when running as a modal
82-
vs. standalone. When running as a modal, there is no "File" menu,
83-
but instead there are "Okay" and "Cancel" buttons.
85+
vs. standalone. When running as a modal, there is no "Quit" menu
86+
item under the "File" menu. Instead there are "Okay" and "Cancel"
87+
buttons.
8488

8589
When "Okay" is hit, askcolor() returns the tuple
8690

@@ -148,6 +152,9 @@ The Colorstrip Window
148152
be slower). Click on "Hexadecimal" to display the arrow numbers
149153
in hex.
150154

155+
There are also two shortcut buttons in this window, which
156+
auto-select Black (0/0/0) and White (255/255/255).
157+
151158
The Proof Window
152159

153160
In the lower left corner of the main window you see two larger
@@ -164,7 +171,7 @@ The Proof Window
164171
RGB value. In that case, the first one found in the text database
165172
is designated the "primary" name, and this is shown under the
166173
Nearest chip. The other names are "aliases" and they are visible
167-
in other Pynche windows.
174+
in the Color List Window (see below).
168175

169176
The Type-in Window
170177

@@ -210,15 +217,15 @@ The Text Window
210217

211218
The Color List Window
212219

213-
The "Color List" window shows every color in the text database
214-
(this window may take a while to come up). In the upper part of
215-
the window you see a scrolling list of all the color names in the
216-
database, in alphabetical order. Click on any color to select it.
217-
In the bottom part of the window is displayed any aliases for the
218-
selected color (those color names that have the same RGB value,
219-
but were found later in the text database). For example, find the
220-
color "Black" and you'll see that its aliases are "gray0" and
221-
"grey0".
220+
The "Color List" window shows every named color in the color name
221+
database (this window may take a while to come up). In the upper
222+
part of the window you see a scrolling list of all the color names
223+
in the database, in alphabetical order. Click on any color to
224+
select it. In the bottom part of the window is displayed any
225+
aliases for the selected color (those color names that have the
226+
same RGB value, but were found later in the text database). For
227+
example, find the color "Black" and you'll see that its aliases
228+
are "gray0" and "grey0".
222229

223230
If the color has no aliases you'll see "<no aliases>" here. If you
224231
just want to see if a color has an alias, and do not want to select a
@@ -258,7 +265,7 @@ The Details Window
258265
around to the other side. Thus if red were at 238 and +25
259266
were clicked, red would have the value 7.
260267

261-
Preseve Distance
268+
Preserve Distance
262269
When the increment or decrement would send any of the tied
263270
variations out of bounds, all tied variations are wrapped as
264271
one, so as to preserve the distance between them. Thus if
@@ -299,7 +306,7 @@ Persistency
299306
When Pynche exits, it saves these values in the init file, and
300307
re-reads them when it starts up. There is no locking on this
301308
file, so if you run multiple instances of Pynche at a time, you
302-
will override the init file.
309+
may clobber the init file.
303310

304311
The actual options stored include
305312

@@ -311,12 +318,32 @@ Persistency
311318
insertion point, and all current text widget element color
312319
settings.
313320

321+
- the name of the color database file (but not its contents)
322+
314323
You can inhibit Pynche from reading the init file by supplying the
315324
--ignore option on the command line. However, you cannot suppress
316325
the storing of the settings in the init file on Pynche exit. If
317326
you really want to do this, use /dev/null as the init file, using
318327
--initfile.
319328

329+
Color Name Database Files
330+
331+
Pynche uses a color name database file to calculate the nearest
332+
color to the selected color, and to display in the Color List
333+
view. Several files are distributed with Pynche, described
334+
below. By default, the X11 color name database file is selected.
335+
Other files:
336+
337+
html40colors.txt -- the HTML 4.0 guaranteed color names
338+
339+
websafe.txt -- the 216 "Web-safe" colors that Netscape and MSIE
340+
guarantee will not be dithered. These are specified in #rrggbb
341+
format for both values and names
342+
343+
webcolors.txt -- The 140 color names that Tim Peters and his
344+
sister say NS and MSIE both understand (with some controversy over
345+
AliceBlue).
346+
320347
To Do
321348

322349
Here's a brief list of things I want to do:

0 commit comments

Comments
 (0)