COLOR_PALETTE Procedure

Standard Library procedure that displays the current color table colors and their associated color table indices.

Note: If you have a 24-bit display, use WgCeditTool and WzColorEdit instead of COLOR_PALETTE.

Usage

  • COLOR_PALETTE

Parameters

None.

Keywords

None.

Discussion

COLOR_PALETTE works only on displays with window systems. It displays the current color table in a new window, along with the corresponding numerical values or color table indices, thereby letting you visually determine the color associated with a particular color index. This window (Motif version only) is shown in COLOR_PALETTE Window. The COLOR_PALETTE window (Motif version). This window displays every other color in the current color table, along with the corresponding numerical value or color table index. The black cells in the upper-right corner

Note: The total number of colors that can appear in the COLOR_PALETTE window is 236, which reflects the current value of !D.N_Colors. The black cells in the upper-right corner of the window represent colors that are not available to PV‑WAVE because they have been reserved by Windows.

COLOR_PALETTE Window

Example 1

; Create an array containing the values for a sine function from
; Create an array containing the values for a sine function from
b = FINDGEN(37)
x = b * 10
y = SIN(x * !Dtor)
; Plot data and set the range to be exactly 0 to 360.
PLOT, x, y, XRange=[0,360], XStyle=1, YStyle=1
; Put up window containing display of the current color table and
; its associated color indices.
COLOR_PALETTE
; Load a predefined color table that contains 32 distinct colors.
TEK_COLOR
; Fill in areas under the curve with different colors.
POLYFILL, x, y, Color=WoColorConvert(6)
POLYFILL, x, y/2, Color=WoColorConvert(3)
POLYFILL, x, y/6, Color=WoColorConvert(4)
; Create an array containing the values for a COS function from
; 0 to 360 degrees.
z = COS(x * !Dtor)
; Plot the cosine data on top of the sine data.
OPLOT, x, z/8, Linestyle=2, Color=WoColorConvert(5)

Example 2

OPENR, lun, !Data_dir + 'head.img', /Get_lun
image = BYTARR(512, 512)
READU, lun, image
LOADCT, 0
TVSCL, image
COLOR_PALETTE
LOADCT, 5
LOADCT, 3

See Also

COLOR_CONVERT,  MODIFYCTWgCeditTool WzColorEdit

For more information about the number of colors that are displayed in the palette, see the PV‑WAVE User Guide.