An Introduction to XColorSel **************************** XColorSel is my first "real" X application. I wanted to do something fairly straightforward, but something which is useful as well. As it turns out, I spent more time with it than I thought I would, adding new features, and playing with all the stuff that makes X so neat. XColorSel is the result. Ok... First, what exactly is XColorSel? Well, basically, its a progam which reads the rgb.txt file on your system. This file comes with your X11 distribution, and it lists the colors which have been set up by name. These colors are most often used when configuring your personal setup, such as in a window manager's config file. These colors are used for much more than that though. For example, if you were to type "Mosaic -fg Red -bg Green ", X looks up the RGB values of these colors and uses them in Mosaic. These colors are all listed for us mere humans in the rgb.txt file, usually located in the x11r?/lib/X11 directory. XColorSel reads this file, uses the RGB values listed there to build the actual colors, and it displays ten of them at a time, along with their corresponding RGB values and their actual name. Why would you want to use XColorSel? Well, while the names in rgb.txt are quite descriptive, they can also be confusing, and well, they say that a picture is worth a thousand words. Actually being able to see the color in question is a great help in deciding wether or not you want to use it. Obviously, you can use XColorSel for whatever you want, but the main purpose I had in mind was in configuring your window manager, xterm windows, etc. If you are playing with anything that needs RGB values at all, the Color Editor could be useful, either for creating a new color, or for altering an existing one in the rgb.txt file. Above all, enjoy the program! Feel free to drop me any comments, questions, or flames you may have about XColorSel. The Main Window **************** (see mainwindow.gif) (1) The Color Windows: +++++++++++++++++++++++ These ten windows display the "official" names of the rgb.txt colors while showing the corresponding color in the background. You can click on any of these windows to bring up the Color Editor with this color. (2) The RGB Windows: +++++++++++++++++++++ These ten windows display the RGB (Red-Green-Blue) values for the color in the Color Window directly to its left. The values are given from red to blue, left to right. The color of the number displayed corresponds directly to the red, green, or blue portion of the color in the Color Window. (3) The Scrolling Buttons: +++++++++++++++++++++++++++ These buttons allow you to scroll through the list of available colors in the rgb.txt file. The double arrows at the top and the bottom of this column will take you to the beginning or the end of the color list. The other buttons will move you up (the top 4 buttons) or down (the bottom 4 buttons) a specific number of colors. The bigger the arrow, the longer it jumps. The values of these jumps are as follows: Smallest arrow: 1 position. Small arrow: 10 positions. Large arrow: 50 positions. Largest arrow: 100 positions. These values should give you more than enough flexibility to successfully navigate the color list. These buttons do not repeat when held down because the massive amounts of thrashing and such that would occur on most systems would make repeat scroll effectively useless. (4) The Control Buttons ++++++++++++++++++++++++ These 6 buttons are used to get help, mail comments, change your cursor, reload the colors, and quit. They are as follows: The Quit button: Used to quit the program, by golly!. The Reload button: Loads the colors from rgb.txt into XColorSel. The Color Editor button: Brings up the Color Editor. The Help button: Brings up this HTML help. The About button: Brings up the About Window. The Cursor button: Switches your pointer between an arrow and a cow. A cow!?! Well sure, why not? :-) (5) The Color Counter +++++++++++++++++++++++ This window tells you how many colors are defined in your rgb.txt file. It also serves as a counter when the colors are being loaded or reloaded. (6) The Position Window +++++++++++++++++++++++++ This window displays your position in the file as a percentage (of colors at and above your current position) from 0-100. XColorSel's Color Editor ************************ (see coloreditor.gif) (1) The Color Window +++++++++++++++++++++ The color in the background of this window is the "current" color. That is, the color which corresponds to the RGB values to the right. (2) The Color Buttons ++++++++++++++++++++++ These six buttons are used to change the current color. The color of each pair of buttons correspond directly to the portion of the RGB spectrum that they will change. The left column of buttons will decrease the red, green, or blue value. The right column will obviously increase it. (3) The Close Button +++++++++++++++++++++ This button closes the Color Editor window. (4) The RGB Window +++++++++++++++++++ This window displays the red, green, and blue values for the current color. As you use the color buttons, these values will change. XColorSel's "About" Window ************************* (See aboutwindow.gif) (1) The Comment Button +++++++++++++++++++++++ Use this button to send comments, bugs, and exorbitant job offers to XColorSel's author. This button will bring up an xterm window running mail. Type in your comments, and when you are done, either type a . (period ) as the first character in a line, or press ^D (Control-d). If you prefer vi, type ~v (tilde and v) as the first 2 characters of a line, and press enter. When you exit vi, you will be back in the mail window, and you still must type a . or ^D to send the message. Type ^C (Control-c) twice to kill the message before it is sent. (2) The Close Button +++++++++++++++++++++ This button will close the "About" window. Jon N. Steiger / stei0302@cs.fredonia.edu / SUNY College at Fredonia