blob: 586e75fc48daacda802a73c8dd0daf4e62066d88 [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 Warsawf3dcafe1998-10-16 22:29:18 +000027Pynche is pronounced `Pinch-ee'. Start it by running the `pynche'
28script. On Windows, run pynche.pyw to inhibit the console window.
Barry Warsawe55055d1998-10-06 23:03:22 +000029
30The top part of the main Pynche window contains the "variation
31strips". Each strip contains a number of "color chips". The strips
32always indicate the currently selected color by a highlight rectangle
33around the selected color chip, with an arrow pointing to the chip.
34Each arrow has an associated number giving you the color value along
35the variation's axis. Each variation strip shows you the colors that
36are reachable from the selected color by varying just one axis of the
37color solid.
38
39For example, when the selected color is (in Red/Green/Blue notation)
40127/127/127, the Red Variations strip shows you every color in the
41range 0/127/127 to 255/127/127. Similarly for the green and blue
42axes. You can select any color by clicking on its chip. This will
43update the highlight rectangle and the arrow, as well as other
44displays in Pynche.
45
46Click on "Update while dragging" if you want Pynche to update the
47selected color while you drag along any variation strip (this will be
48slower). Click on "Hexadecimal" to display the arrow numbers in hex.
49
50In the lower left corner of the main window you see two larger color
51chips. The Selected chip shows you a larger version of the color
52selected in the variation strips, along with its X11 color
53specification. The Nearest chip shows you the closest color in the
54X11 database to the selected color, giving its X11 color name.
55Clicking on the Nearest color chip selects that color. Color distance
56is calculated in the 3D space of the RGB color solid and if more than
57one color name is the same distance from the selected color, the first
58one found will be chosen.
59
60Note that there may be more than one X11 color name for the same RGB
61value. In that case, the first one found in the text database is
62designated the "primary" name, and this is shown under the Nearest
63chip. The other names are "aliases" and they are visible in other
64Pynche windows.
65
66At the lower right of the main window are three entry fields. Here
67you can type numeric values for any of the three color axes. Legal
68values are between 0 and 255, and these fields do not allow you to
69enter illegal values. You must hit Enter or Tab to select the new
70color.
71
72Click on "Update while typing" if you want Pynche to select the color
73on every keystroke (well, every one that produces a legal value!).
74Click on "Hexadecimal" to display and enter color values in hex.
75
76There are three secondary windows which are not displayed by default.
77You can bring these up via the "View" menu on the main Pynche window.
78
79The "Text Window" allows you to see what effects various colors have
80on the standard Tk text widget elements. In the upper part of the
81window is a plain Tk text widget and here you can edit the text,
82select a region of text, etc. Below this is a button "Track color
83changes". When this is turned on, any colors selected in the other
84windows will change the text widget element specified in the radio
85buttons below. When this is turned off, text widget elements are not
86affected by color selection.
87
88You can choose which element gets changed by color selection by
89clicking on one of the radio buttons in the bottom part of this
90window. Text foreground and background affect the text in the upper
91part of the window. Selection foreground and background affect the
92colors of the primary selection which is what you see when you click
93the middle button (depending on window system) and drag it through
94some text.
95
96The Insertion is the insertion cursor in the text window, where new
97text will be inserted as you type. The insertion cursor only has a
98background.
99
100The "Color List" window shows every color in the text database. This
101is the primary reason why Pynche doesn't work so well on 8-bit
102screens. In the upper part of the window you see a scrolling list of
103all the color names in the database, in alphabetical order. Click on
104any color to select it. In the bottom part of the window is displayed
105any aliases for the selected color (those color names that have the
106same RGB value, but were found later in the text database). For
107example, find the color "Black" and you'll see that its aliases are
108"gray0" and "grey0".
109
110If the color has no aliases you'll see "<no aliases>" here. If you
111just want to see if a color has an alias, and do not want to select a
112color when you click on it, turn off "Update on Click".
113
114Note that the color list is always updated when a color is selected
115from the main window. There's no way to turn this feature off. If
116the selected color has no matching color name you'll see
117"<no matching color>" in the Aliases window.
118
119The "Details" window gives you more control over color selection than
120just clicking on a color chip in the main window. The row of buttons
121along the top apply the specified increment and decrement amounts to
122the selected color. These delta amounts are applied to the variation
123strips specified by the check boxes labeled "Move Sliders". Thus if
124just Red and Green are selected, hitting -10 will subtract 10 from the
125color value along the red and green variation only. Note the message
126under the checkboxes; this indicates the primary color level being
127changed when more than one slider is tied together. For example, if
128Red and Green are selected, you will be changing the Yellow level of
129the selected color.
130
131The "At Boundary" behavior determines what happens when any color
132variation hits either the lower or upper boundaries (0 or 255) as a
133result of clicking on the top row buttons:
134
135 Stop
136 When the increment or decrement would send any of the tied
137 variations out of bounds, the entire delta is discarded.
138
139 Wrap Around
140 When the increment or decrement would send any of the tied
141 variations out of bounds, the out of bounds value is wrapped
142 around to the other side. Thus if red were at 238 and +25
143 were clicked, red would have the value 7.
144
145 Preseve Distance
146 When the increment or decrement would send any of the tied
147 variations out of bounds, all tied variations are wrapped as
148 one, so as to preserve the distance between them. Thus if
149 green and blue were tied, and green was at 238 while blue was
150 at 223, and +25 were clicked, green would be at 15 and blue
151 would be at 0.
152
153 Squash
154 When the increment or decrement would send any of the tied
155 variations out of bounds, the out of bounds variation is set
156 to the ceiling of 255 or floor of 0, as appropriate. In this
157 way, all tied variations are squashed to one edge or the
158 other.
159
160The top row buttons have the following keyboard accelerators:
161
162 -25 == Shift Left Arrow
163 -10 == Control Left Arrow
164 -1 == Left Arrow
165 +1 == Right Arrow
166 +10 == Control Right Arrow
167 +25 == Shift Right Arrow
168
169Other keyboard accelerators:
170
171 Alt-w in any secondary window dismisses the window. In the main
172 window it exits Pynche.
173
174 Alt-q in any window exits Pynche.