WzColorEdit Procedure

Starts a VDA Tool used for editing the image and plot color tables used in other VDA Tools.

Usage

WzColorEdit[, var1[, var2, var3]]

Input Parameters

var1 — (optional) If only one variable is specified, it must be a 2D array (or equivalent expression) containing 3-by-n or n-by-3 elements, where n is the number of color values to use when initializing the color table.

Note:

If three variables are specified, all three must be 1D arrays of equal length or equivalent expressions. The input variables are used as a triplet to specify the three components of the color table: (red, green, blue) for the RGB model; (hue, saturation, value) for the HSV model; or (hue, lightness, saturation) for the HLS model. See the Discussion for the ranges of these variables.

var2 — (optional) A 1D array or equivalent expression used with both var1 and var3 that is of the same length as var1 and var3. The array contains the number of color values to use for the second component of the color model when initializing the color table.

var3 — (optional) A 1D array or equivalent expression used with both var1 and var2 that is of the same length as var1 and var2. The array contains the number of color values to use for the third component of the color model when initializing the color table.

Keywords

Cmap — The index of a predefined color map to load when the color table is initialized. This color map is loaded before the input variables, if any, are written into the color map.

Hls — If set, the HLS color system (hue, lightness, saturation) is used, instead of the default (RGB) color system.

Hsv — If set, the HSV color system (hue, saturation, value) is used, instead of the default (RGB) color system.

Image — If set, the image color table is displayed.

Note:

If neither Image nor Plot is specified, both color tables are displayed.

NoBlock — If specified, the event loop (WwLoop) that is started by the VDA Tool will use the given value. By default a value of 1 (non-blocking loop) will be used. However, it may be necessary in certain circumstances to force a non-blocking loop by specifying NoBlock = 2. (See WwLoop in the PV‑WAVE Application Developer’s Guide for more information.)

Parent — If used, specifies the relationship of the WzColorEdit Tool to the widget ID of the parent shell. Otherwise, a new top level shell is created for the tool.

Plot — If set, the plot color table is displayed.

Position — Specifies the x and y (horizontal and vertical) coordinates in pixels for the starting location of the upper-left corner of the VDA Tool window.

Range — A 1D array specifying the range of colors to display. This array contains four elements:

[image_start_color, image_end_color, plot_start_color, plot_end_color].

If the range is not specified, the IMAGE_RANGE and PLOT_RANGE global variables are used.

Restore — A data structure that has been saved in the Tools Manager with the TmSaveTools function. This keyword is reserved for internal use; it is not to be used at the command line (see Discussion).

Template — If specified, the contents of the named template are restored.

Discussion

The Restore keyword is used specifically by the TM_RESTORE method. For information on the TM_RESTORE method, refer to the source code for WzColorEdit in:

<wavedir>/lib/vdatools/wzcoloredit.pro 
<wavedir>\lib\vdatools\wzcoloredit.pro

Where <wavedir> is the main PV‑WAVE directory.

The ranges of the input variables depend on the type of color system that is specified. The components of each color system can have specific ranges of values, shown in Color System Ranges.

Color System Ranges

Color System Component

Input Variable Range

r, g, b

0 – 255

hue

0 – 360

saturation, lightness, value

0 – 1.0

The WzColorEdit Tool can be called from either a Navigator Tool, or directly from the command line. This VDA Tool allows you to select and modify the color table to be used by all other VDA Tools for both the image and the plot colors.

Using a menu bar selection, you can pick from a number of predefined system color tables, or create and save your own custom color tables. As you make selections and/or changes to those selections, all other VDA Tools that are running are updated, so you can see the results of the color edits right after making them.

The editing capabilities included in this VDA Tool let you change a single cell or a range of cells at the same time. Changes to a single cell can be made using control area sliders, or a color wheel dialog box. Changes to a range of color table cells are made by applying a ramp function between two specified color table indices. The ramp method can be linear, logarithmic, or exponential.

Note:

If the beginning index you specify for the ramp function is larger than the ending index, the VDA Tool ignores the index order when applying the ramp.

Example

In this example, the WzColorEdit Tool with the HSV color model is called from the WAVE> prompt.

hue = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330]
; The three 1D variables are defined with equal lengths of n = 12.
saturation = FLTARR(12)
saturation(*) = 1.0
value = saturation
; The VDA Tool appears with the first 6 color indices in the image
; colors set to the values specified and the color model controls
; set for hue, saturation, and value.
WzColorEdit, hue, saturation, value, /Hsv

See Also

LOADCT