blob: 17758841003c61b3baec0cb19d76bbff4419c5cb [file] [log] [blame]
Barry Warsawe55055d1998-10-06 23:03:22 +00001Pynche - The PYthonically Natural Color and Hue Editor
2Copyright (C) 1998 CNRI
3Author: Barry A. Warsaw <bwarsaw@python.org>
4
5Pynche is a color editor based largely on a similar program that I
6originally back in 1987 for the Sunview window system. That editor
7was called ICE, the Interactive Color Editor. I'd always wanted to
8port this program to X but didn't feel like hacking X and C code to do
9it. Fast forward many years, to where Python + Tkinter provides such
10a nice programming environment, with enough power, that I finally
11buckled down and implemented it. I changed the name because these
12days, too many other systems have the acronym `ICE'.
13
14Pynche has been tested with Python 1.5.1 using Tk 8.0. It probably
15works with Python 1.5. I've tested it on both Solaris 2.6 and Windows
16NT. There are some funky things that happen on Windows but I think
17they are primarily Tk problems. You'll want to be sure to have Tk
Barry Warsawcd63dc91998-10-06 23:09:49 +0000188.0.3 for Windows. Also, Pynche is very colormap intensive, so it
19doesn't work very well on 8-bit graphics cards. I'll probably fix
20that in the future.
Barry Warsawe55055d1998-10-06 23:03:22 +000021
22Pynche must find a text database of colors, in the X11 format. Pynche
23is distributed with an rgb.txt file from the X11R6.4 distribution for
24this reason, but you can use a different file with the -d option. The
25file xlicense.txt contains the license only for rgb.txt.
26
Barry Warsawcd63dc91998-10-06 23:09:49 +000027Pynche is pronounced `Pinch-ee'. Start it by running the pynche.py
28driver. On Windows, you probably want to rename pynche.py to
29pynche.pyw so that it doesn't bring up a console window.
Barry Warsawe55055d1998-10-06 23:03:22 +000030
31The top part of the main Pynche window contains the "variation
32strips". Each strip contains a number of "color chips". The strips
33always indicate the currently selected color by a highlight rectangle
34around the selected color chip, with an arrow pointing to the chip.
35Each arrow has an associated number giving you the color value along
36the variation's axis. Each variation strip shows you the colors that
37are reachable from the selected color by varying just one axis of the
38color solid.
39
40For example, when the selected color is (in Red/Green/Blue notation)
41127/127/127, the Red Variations strip shows you every color in the
42range 0/127/127 to 255/127/127. Similarly for the green and blue
43axes. You can select any color by clicking on its chip. This will
44update the highlight rectangle and the arrow, as well as other
45displays in Pynche.
46
47Click on "Update while dragging" if you want Pynche to update the
48selected color while you drag along any variation strip (this will be
49slower). Click on "Hexadecimal" to display the arrow numbers in hex.
50
51In the lower left corner of the main window you see two larger color
52chips. The Selected chip shows you a larger version of the color
53selected in the variation strips, along with its X11 color
54specification. The Nearest chip shows you the closest color in the
55X11 database to the selected color, giving its X11 color name.
56Clicking on the Nearest color chip selects that color. Color distance
57is calculated in the 3D space of the RGB color solid and if more than
58one color name is the same distance from the selected color, the first
59one found will be chosen.
60
61Note that there may be more than one X11 color name for the same RGB
62value. In that case, the first one found in the text database is
63designated the "primary" name, and this is shown under the Nearest
64chip. The other names are "aliases" and they are visible in other
65Pynche windows.
66
67At the lower right of the main window are three entry fields. Here
68you can type numeric values for any of the three color axes. Legal
69values are between 0 and 255, and these fields do not allow you to
70enter illegal values. You must hit Enter or Tab to select the new
71color.
72
73Click on "Update while typing" if you want Pynche to select the color
74on every keystroke (well, every one that produces a legal value!).
75Click on "Hexadecimal" to display and enter color values in hex.
76
77There are three secondary windows which are not displayed by default.
78You can bring these up via the "View" menu on the main Pynche window.
79
80The "Text Window" allows you to see what effects various colors have
81on the standard Tk text widget elements. In the upper part of the
82window is a plain Tk text widget and here you can edit the text,
83select a region of text, etc. Below this is a button "Track color
84changes". When this is turned on, any colors selected in the other
85windows will change the text widget element specified in the radio
86buttons below. When this is turned off, text widget elements are not
87affected by color selection.
88
89You can choose which element gets changed by color selection by
90clicking on one of the radio buttons in the bottom part of this
91window. Text foreground and background affect the text in the upper
92part of the window. Selection foreground and background affect the
93colors of the primary selection which is what you see when you click
94the middle button (depending on window system) and drag it through
95some text.
96
97The Insertion is the insertion cursor in the text window, where new
98text will be inserted as you type. The insertion cursor only has a
99background.
100
101The "Color List" window shows every color in the text database. This
102is the primary reason why Pynche doesn't work so well on 8-bit
103screens. In the upper part of the window you see a scrolling list of
104all the color names in the database, in alphabetical order. Click on
105any color to select it. In the bottom part of the window is displayed
106any aliases for the selected color (those color names that have the
107same RGB value, but were found later in the text database). For
108example, find the color "Black" and you'll see that its aliases are
109"gray0" and "grey0".
110
111If the color has no aliases you'll see "<no aliases>" here. If you
112just want to see if a color has an alias, and do not want to select a
113color when you click on it, turn off "Update on Click".
114
115Note that the color list is always updated when a color is selected
116from the main window. There's no way to turn this feature off. If
117the selected color has no matching color name you'll see
118"<no matching color>" in the Aliases window.
119
120The "Details" window gives you more control over color selection than
121just clicking on a color chip in the main window. The row of buttons
122along the top apply the specified increment and decrement amounts to
123the selected color. These delta amounts are applied to the variation
124strips specified by the check boxes labeled "Move Sliders". Thus if
125just Red and Green are selected, hitting -10 will subtract 10 from the
126color value along the red and green variation only. Note the message
127under the checkboxes; this indicates the primary color level being
128changed when more than one slider is tied together. For example, if
129Red and Green are selected, you will be changing the Yellow level of
130the selected color.
131
132The "At Boundary" behavior determines what happens when any color
133variation hits either the lower or upper boundaries (0 or 255) as a
134result of clicking on the top row buttons:
135
136 Stop
137 When the increment or decrement would send any of the tied
138 variations out of bounds, the entire delta is discarded.
139
140 Wrap Around
141 When the increment or decrement would send any of the tied
142 variations out of bounds, the out of bounds value is wrapped
143 around to the other side. Thus if red were at 238 and +25
144 were clicked, red would have the value 7.
145
146 Preseve Distance
147 When the increment or decrement would send any of the tied
148 variations out of bounds, all tied variations are wrapped as
149 one, so as to preserve the distance between them. Thus if
150 green and blue were tied, and green was at 238 while blue was
151 at 223, and +25 were clicked, green would be at 15 and blue
152 would be at 0.
153
154 Squash
155 When the increment or decrement would send any of the tied
156 variations out of bounds, the out of bounds variation is set
157 to the ceiling of 255 or floor of 0, as appropriate. In this
158 way, all tied variations are squashed to one edge or the
159 other.
160
161The top row buttons have the following keyboard accelerators:
162
163 -25 == Shift Left Arrow
164 -10 == Control Left Arrow
165 -1 == Left Arrow
166 +1 == Right Arrow
167 +10 == Control Right Arrow
168 +25 == Shift Right Arrow
169
170Other keyboard accelerators:
171
172 Alt-w in any secondary window dismisses the window. In the main
173 window it exits Pynche.
174
175 Alt-q in any window exits Pynche.