WoColorConvert Function
Convert from a long RGB value to an index into the current color table, or from an index in the current color table to an RGB value.
Usage
result = WoColorConvert(color)
Input Parameters
color — The input RGB value or color index.
Returned Value
The returned value depends on the type of system and the keyword parameters that are used. Return values for some typical systems are shown in
Table 19-1: Return Values for Common Systems.
Keywords
ColorToIndex — If nonzero, converts an RGB value to a color table index.
IndexToColor — If nonzero, converts a color table index to an RGB value. This is the default if no keyword is set.
Discussion
WoColorConvert ensures that a selected color (e.g., in a VDA Tool application) looks the same on 8-bit and 24-bit dispays.
The ColorToIndex and IndexToColor keywords are mutually exclusive.
The color conversion only occurs on 24-bit systems; the original color index is returned for other display types.
Example
The following PLOT command uses WoColorConvert to convert the plot color so that it works properly on a 24-bit display.
color = 4
seed=2
PLOT, RANDOMN(seed,20), Color=WoColorConvert(color, $
/IndexToColor)
See Also