The TVLCT procedure loads the display color translation tables from the specified variables. Although IDL uses the RGB color system internally, color tables can be specified to TVLCT using any of the following color systems: RGB (Red, Green, Blue), HLS (Hue, Lightness, Saturation), and HSV (Hue, Saturation, Value). Alpha values may also be used when using the second form of the command. The type and meaning of each argument is dependent upon the color system selected, as described below. Color arguments can be either scalar or vector expressions. If no color-system keywords are present, the RGB color system is used.
TVLCT, V1, V2, V3 [, Start] [, /GET] [, /HLS | , /HSV]
or
TVLCT, V [, Start] [, /GET] [, /HLS | , /HSV]
TVLCT will accept either three n-element vectors (V1, V2, and V3) or a single n-by-3 array (V) as an argument. The vectors (or columns of the array) have different meanings depending on the color system chosen. If an array V is specified, V[*,0] is the same as V1, V[*,1] is the same as V2, V[*,2] is the same as V3. In the description below, we assume that three vectors, V1, V2, and V3 are specified.
The V1, V2, and V3 arguments have different meanings depending upon which color system they represent.
The parameters V1, V2, and V3 contain the Red, Green, and Blue values, respectively. Values are interpreted as integers in the range 0 (lowest intensity) to 255 (highest intensity). The parameters can be scalars or vectors of up to 256 elements. By default, the three arguments are assumed to be R, G, and B values.
Parameters V1, V2, and V3 contain the Hue, Lightness, and Saturation values respectively. All parameters are floating-point. Hue is expressed in degrees and is reduced modulo 360. V2 (lightness) and V3 (saturation) and can range from 0 to 1.0. Set the HLS keyword to have the arguments interpreted this way.
Parameters V1, V2, and V3 contain values for Hue, Saturation, and Value (similar to intensity). All parameters are floating-point. Hue is in degrees. The Saturation and Value can range from 0 to 1.0. Set the HSV keyword to have the arguments interpreted this way.
An integer value that specifies the starting point in the color translation table into which the color intensities are loaded. If this argument is not specified, a value of zero is used, causing the tables to be loaded starting at the first element of the translation tables.
Set this keyword to return the RGB values from the internal color tables into the V1, V2, and V3 parameters. For example, the statements:
TVLCT, H, S, V, /HSV TVLCT, R, G, B, /GET
load a color table based in the HSV system, and then read the equivalent RGB values into the variables R, G, and B.
Set this keyword to indicate that the parameters specify color using the HLS color system.
Set this keyword to indicate that the parameters specify color using the HSV color system.
; Initialize display. DEVICE, DECOMPOSED = 0 ; Create a set of R, G, and B colormap vectors: R = BYTSCL(SIN(FINDGEN(256))) G = BYTSCL(COS(FINDGEN(256))) B = BINDGEN(256) ; Load these vectors into the color table: TVLCT, R, G, B ; Display an image to see the effect of the new color table: TVSCL, DIST(400)
Introduced: Original