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