FindColor - a Public Screen "color by name" database ---------------------------------------------------- Copyright ©1993 by Timothy B. Kreuzer. All rights reserved. Version: 1.0a Author: Tim Kreuzer (and the KreuzerSoft support team) Language: SAC/C V6.3 Features: Opens on the default public screen (initially the Workbench) Features 507 pre-defined color names (from the X Window system) Displays the actual color and the RGB values for all 507 named colors RGB values can be modified and restored for a selected color Will find the first color in the current screen palette that matches the current RGB values "Smart" iconify function Upon exit, restores palette to where it was at start-up Separate versions for: 68020 CPU (A1200) 68030 CPU (A1200/A4000) 68040 CPU (A4000) Tested OK using the Enforcer Limitations: Can only be used from the Workbench (start via Icon). Requires AmigaDOS 3.0+ and the AGA chipset. Requires an 8-color screen at a minimum *********** *IMPORTANT*: The display of the currently selected (or modified) color *********** requires that FindColor allocate and use one of the pens/ registers on the current default Public Screen. FindColor uses the 3.0 ObtainPen function to select the pen/register it uses, and therefore should not (normally) cause any noticeable change in the screen display. ObtainPen is one of Commodore's ways of promoting the sharing of a screen's palette under 3.0/AGA. Once ObtainPen is used to obtain a pen/register, that pen/ register will not be available to any other program which itself attempts to get screen pens/registers using ObtainPen. HOWEVER, most (non-Commodore) programs do not (yet) use the ObtainPen function. If you are using such programs, it is likely (though not definite) that FindColor may cause one of the colors displayed via another program (on same screen) to change. WindowBlender is the only PD 3.0/AGA program I know of which uses ObtainPen (at this writing). Note that the RGB values of the pen/register used by FindColor are restored (upon exit) to where they were at program start-up, so all is well in the end. Also, the pen/register retrieved via ObtainPen will once again be available to other programs (via call to ReleasePen). It is likely that all the above will never come into play for you. I only mention this so that you'll understand how FindColor operates. FYI: the "Find" button uses another 3.0 function (called, strangely enough, "FindColor") to find the closest matching color from the current screen's palette. This is another example of Commodore's moving towards a "shared screen palette" approach. Changes in Version 1.0a ----------------------- 1) Changed the pen/register used to display the currently selected color from: - the (hardcoded) "last pen/register on the current default Public Screen" to - "obtained from the list of free pen/registers on the default Public Screen as returned by the 3.0 function ObtainPen". This should have the added benefit of minimizing (or eliminating) the possibility of having FindColor change an already-displayed screen color when you use it. This is especially true for the Workbench screen. Read the *IMPORTANT* notice above for more information on this. 2) Given the adoption of the ObtainPen method (see above), it is possible that FindColor will not be able to obtain a free pen/register. In this case, the user is asked: - if they want FindColor to use the (sequentially) last pen/register on the current default Public Screen or - if they want to exit FindColor. I realize that this potentially "breaks" the 3.0 shared-palette rules, but at least is puts the control (rightfully) back in the in the hands of the user. 3) Corrected the spelling of the "Navajo White ..." colors. They were spelled "Mavajo White ...". Why did I create FindColor, and what will it do for me? ------------------------------------------------------- After using the X and Open Windows environments for the past several years, I got very used to the manner in which one can select display colors by name instead of by their RGB values. Being "color ignorant" as well, I found it much easier to pick colors by name. FindColor is my way of allowing a limited degree of "color by name" selection on the Amiga. FindColor can be used to "see" what a named color looks like, and what it's RGB values are. These RGB values can then be used in your favorite Amiga color-related application. FindColor will also allow you to modify the selected colors RGB values. Once you have "tweaked" an RGB value, the "Restore" button can be used to set the RGB values back to their original settings. Lastly, FindColor will locate the first color (by color register #) in the current screen's palette which most closely matches the current RGB settings. If you use this feature, remember that the color register #'s begin with "0". What would be nice ------------------ It would be wonderful if Amiga applications in general were able to support an integrated "color by name" facility. Maybe this will happen at some point down the road. I'm planning on integrating a "color by name" selection capablity into my PaletteTool program. How you can help ---------------- I'd welcome any comments or suggestion on FindColor, and it's color-name database. Especially any comments on the accuracy of the RGB values, or suggestions for new color names/RGB settings. Also -> I'm more than willing to distribute the color definitions and the actual program source code for use by other "C" programmers. Drop me a line if you are interested in this. Note to X/Open Window users --------------------------- You may notice that I have not implemented an exact, 100% match to the X/Open Window color names. In summary, the differences are: - I have removed all color names whose RGB values were duplicates. - All color names having variations have their first variation named with a suffix of "2". ------------------------- How do you use FindColor? ------------------------- Just click on the FindColor icon. FindColor will open it's window on the default Public Screen. Note that the Workbench screen is the initial default Public Screen. ---------------------------- FindColor window description ---------------------------- The FindColor window consists of the following items: 1) A scrolling list of color names. To see a given color, select it's name using the left mouse button. The currently selected color (name) will be highlighted in the scrolling list. 2) A bevel box where the currently selected color is displayed. Above this box, the name of the select color is repeated. This is done in case you scroll the the list of color names away from the highlighted name. 3) Three color modification sliders, one each for the Red (Red), Green (Grn), and Blue (Blu) color components. These can be used to modify the RGB values of the currently selected color. NOTE that the RGB modifications are TEMPORARY. That is, they are not saved when you "Restore" the color, or when you select a different color name. 4) A "Find" button, which will search the current screen's palette for the color register having the closest matching RGB values to those on the RGB "sliders". The "closest matching" color register is shown in the box to the right of the "Find" button. 5) A "Restore" button, which will reset the selected color's RGB values to their pre-defined settings. This is useful if you have adjusted the RGB values for the selected color, and wish to get back to the color's pre-defined RGB settings. NOTE that this button is disabled ("ghosted") when you initially select a color name. It is only enabled if you adjust an RGB value using the sliders. This was done as a visual cue, so you know whether you are viewing the "pre-defined" RGB values. Re-selecting the same color name from the scrolling list has the same effect. 6) An "I" (Iconify) button, which changes the FindColor window into a single ("Open") button. Pressing the Open button will restore the FindColor window. FindColor remembers the last position of both it's main and iconified windows, and will re-open the windows at those locations. 7) A "?" (About) button, which opens an Author/Release info requester. -------------- Icon Tooltypes -------------- X = - The X-coordinate at which the FindColor window will initially open. Y = - The Y-coordinate at which the FindColor window will initially open. If these tooltypes are not present, the FindColor window will open at coordinates X=10 Y=10. Credits/Miscellaneous --------------------- The GUI for FindColor was developed using Jan van den Baards' wonderful GadToolsBox. Window Blender is a fantastic 3.0/AGA graphics program written by Fred Mitchell. Thanks to the KreuzerSoft support team. Thanks to the Nations Capital Amiga Users Group (NCUAG). Thanks to Commodore for the Amiga, and to Jan van den Baard for making the development of GUI's on the Amiga child's play. Thanks to Joesph Luk for suggesting the Obtain/ReleasePen method added in Version 1.0a. Thanks to Dave at Buried Treasure in Rockville, MD. ************************************************* *** SUPPORT YOUR LOCAL AMIGA DEALERS, PEOPLE! *** ************************************************* Special thanks to Commodore for (finally) releasing the 3.0 Includes and Libraries! Now all I need are the "Official" Reference Manuals. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >> Please let me know if you have any problems/suggestions/comments/etc. << >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< I can be reached at T.KREUZER on GEnie, or via regular mail at: 6711A N. Washington Blvd. Arlington, VA 22213 Legal Section ------------- FindColor Version 1.0a Copyright ©1993 by Timothy B. Kreuzer. All rights reserved. FindColor is freely redistributable, as long as the following rules are followed: - This doc file must be kept with the executable(s), and must include the above copyright notice. - You may not charge any fee for this program, other than the basic cost of distribution media and/or BBS access. Of course if you want to pursue selling this, feel free drop me a line. Distribution of FindColor (as with ALL KreuzerSoft projects) as part of the Fred Fish collection is DEFINITELY allowed! Commercial Section ------------------ The following KreuzerSoft projects are (hopefully) available on a BBS near you: PST V1.0a - Public Screen Tool for 3.0/AGA. Fractal V1.1 - Mandelbrot set program for 3.0/AGA. LyapunovSpace V1.1 - Lyapunov fractal program for 3.0/AGA. Terrain V1.1 - 3-D fractal terrain program for 3.0/AGA. PaletteTool V1.2 - Public Screen palette program for 3.0/AGA. Worm V1.1 - Port of SUN-Unix graphic toy for all Amigas. DLA - Diffusion Limited Aggregation simulation for all Amigas. Jimi - 8-color Jimi Hendrix image for your Workbench. All for the incredibly low, low price of FREE!