spedas/gui/utilities/
pickcolorname.pro
NAME: PICKCOLORNAME PURPOSE: The purpose of this program is to provide a blocking or modal widget interface for selecting a color "name". The program uses colors familiar to the FSC_COLOR program, and is often used to select a color name for passing to FSC_COLOR. AUTHOR: FANNING SOFTWARE CONSULTING: David Fanning, Ph.D. 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com CATEGORY: Graphics, Color Specification. CALLING SEQUENCE: colorName = PickColorName(startColorName) OPTIONAL INPUT PARAMETERS: startColorName: A string with the "name" of the color. Colors available are these: Almond Antique White Aquamarine Beige Bisque Black Blue Blue Violet Brown Burlywood Charcoal Chartreuse Chocolate Coral Cornsilk Cyan Dark Goldenrod Dark Gray Dark Green Dark Khaki Dark Orchid Dark Salmon Deep Pink Dodger Blue Firebrick Forest Green Gold Goldenrod Gray Green Green Yellow Honeydew Hot Pink Indian Red Ivory Khaki Lavender Lawn Green Light Coral Light Cyan Light Gray Light Salmon Light Yellow Lime Green Linen Magenta Maroon Medium Gray Medium Orchid Moccasin Navy Olive Olive Drab Orange Orange Red Orchid Pale Goldenrod Pale Green Papaya Peru Pink Plum Powder Blue Purple Red Rose Rosy Brown Royal Blue Saddle Brown Salmon Sandy Brown Sea Green Seashell Sienna Sky Blue Slate Gray Snow Spring Green Steel Blue Tan Thistle Tomato Turquoise Violet Violet Red Wheat White Yellow The color WHITE is used if this parameter is absent. INPUT KEYWORD PARAMETERS: BOTTOM: The colors used in the program must be loaded somewhere in the color table. This keyword indicates where the colors start loading. By default BOTTOM is set equal to !D.Table_Size-NCOLORS-1. COLUMNS: Set this keyword to the number of columns the colors should be arranged in. FILENAME: The string name of an ASCII file that can be opened to read in color values and color names. There should be one color per row in the file. Please be sure there are no blank lines in the file. The format of each row should be: redValue greenValue blueValue colorName Color values should be between 0 and 255. Any kind of white-space separation (blank characters, commas, or tabs) are allowed. The color name should be a string, but it should NOT be in quotes. A typical entry into the file would look like this: 255 255 0 Yellow GROUP_LEADER: This identifies a group leader if the program is called from within a widget program. Note that this keyword MUST be provided if you want to guarantee modal widget functionality. (If you don't know what this means, believe me, you WANT to use this keyword, always.) INDEX: This keyword identifies a color table index where the selected color is to be loaded when the program exits. The default behavior is to restore the input color table and NOT load a color. TITLE: This keyword accepts a string value for the window title. The default is "Select a Color". OUTPUT KEYWORD PARAMETERS: CANCEL: On exit, this keyword value is set to 0 if the user selected the ACCEPT button. IF the user selected the CANCEL button, or closed the window in any other way, this keyword value is set to 1. COMMON BLOCKS: None. SIDE EFFECTS: Colors are loaded in the current color table. The input color table is restored when the program exits. This will only be noticable on 8-bit displays. The startColorName is returned if the user cancels or destroys the widget before a selection is made. Users should check the CANCEL flag before using the returned color. EXAMPLE: To call the program from the IDL comamnd line: IDL> color = PickColorName("red") & Print, color To call the program from within a widget program: color = PickColorName("red", Group_Leader=event.top) & Print, color MODIFICATION HISTORY: Written by: David Fanning, 31 August 2000. Modified program to read colors from a file and to use more colors on 24-bit platforms. 16 October 2000. DWF. Added the COLUMNS keyword. 16 October 2000. DWF. Fixed a small problem with mapping a modal widget. 2 Jan 2001. DWF Now drawing small box around each color. 13 March 2003. DWF.
Routines
Routines from pickcolorname.pro
PickColorName_CenterTLB, tlb
result = PickColorName_RGB_to_24Bit(number)
result = PickColorName_Count_Rows(filename, MaxRows=MaxRows)
PickColorName_Select_Color, event
PickColorName_Buttons, event
result = PickColorName(theName, Bottom=Bottom, Cancel=Cancel, Columns=Columns, Filename=Filename, Group_Leader=Group_Leader, Index=Index, Title=Title)
Routine details
File attributes
Modification date: | Thu Feb 13 16:41:46 2014 |
Lines: | 314 |