COLORTOOL__DEFINE Name
COLORTOOL Purpose
The purpose of the ColorTool object is to allow the user to construct and manage
a color table. Standard color tables can be loaded, drawing colors can be
specified by name and value, etc. Calling the DRAW method on a Colortool object causes
that object's color table to be loaded in IDL's hardware color table. A fundamental
principle of the Catalyst Library is that every piece of data should have associated
with it a color table by which it can be displayed, and a coordinate system which will
establish a data coordinate system for the data. The COLORTOOL performs the former function.
It can be set and retrieved from data objects by using the COLOR_OBJECT keyword in
SetProperty and GetProperty methods. ColorTool objects are often inherited by objects.
For example, if you add a data object to a draw widget, the data object is likely to
inherit the ColorTool object of the draw widget. This makes it easy to establish a
consistent color scheme for all objects being displayed in a single draw widget.
Author
FANNING SOFTWARE CONSULTING BURRIDGE COMPUTING
1645 Sheely Drive 18 The Green South
Fort Collins, CO 80526 USA Warborough, Oxon, OX10 7DN England
Phone: 970-221-0438 Phone: +44 (0) 1865 858 279
E-mail: davidf@dfanning.com davidb@burridgecomputing.co.uk
Superclasses
CATATOM
CATCONTAINER
IDL_CONTAINER
Syntax
colorObject = Obj_New('COLORTOOL')
Class Structure
class = { COLORTOOL, $ ; The COLORTOOL object definition.
INHERITS CATATOM, $ ; Inherits the CATATOM object class.
_brewer: 0B, $ ; Flag that indicates a brewer color table.
_r: BytArr(256), $ ; The red color table vector.
_g: BytArr(256), $ ; The green color table vector.
_b: BytArr(256), $ ; The blue color table vector.
_colornames: Ptr_New(), $ ; The names of "known" colors.
_rvalue: Ptr_New(), $ ; The red color values associated with color names.
_gvalue: Ptr_New(), $ ; The red color values associated with color names.
_bvalue: Ptr_New(), $ ; The red color values associated with color names.
_colorfile: "", $ ; The name of the color table file to read.
_ncolors: 0L, $ ; The number of colors in standard color table.
_bottom: 0L, $ ; The starting index of the standard color table.
_scTLB: Obj_New(), $ ; The SHOWCOLORS tlb object.
_selTLB: Obj_New(), $ ; The SELECTCOLORS tlb object.
_xcTLB: Obj_New(), $ ; The XCOLORS tlb object.
_xc_registerName: "", $ ; The name with which the XCOLORS dialog is registered.
_ctindex: 0L, $ ; The current color table index.
_r_old: BytArr(256), $ ; The old red color table vector.
_g_old: BytArr(256), $ ; The old green color table vector.
_b_old: BytArr(256) $ ; The old blue color table vector.
}
Messages
COLORTOOL_TABLECHANGE: A message with this title is sent when color table vectors are
changed in the object. In additon to the message, a DATA keyword is
used to pass an anonymous structure containing the current R, G, and
B color table vectors, along with the BOTTOM index for loading the vectors.
COLORTOOL_SETPROPERTY: A message with this title is sent any time the SetProperty method is
called. No data is sent. Message recipients can call the GetPropery
method on the message SENDER to obtain appropriate information.
Modification History
Written by: David W. Fanning, 13 March 2003.
Added system color names to GETCOLOR method. DWF. 23 Jan 2004.
Modified the way ShowColors method works if a ShowColors window is on the display. Now
current colors are always displayed when ShowColors is called. DWF, 26 Jan 2004.
Added Stretch method to object. DWF, 26 Jan 2004.
Added support for 8-bit displays to GETCOLOR method. DWF. 25 Aug 2004.
Added support for BREWER color tables. 25 June 2008. DWF.
Added PICKCOLORNAME method. 7 July 2008. DWF.
Additional changes to BREWER support. 25 October 2008. DWF.