API documentation for visualization library

Michael Galloy

single page | use frames     summary     class     fields     routine details     file attributes



includes main-level program

top vis_index2rgb

direct graphics

result = vis_index2rgb(indices [, /hex])

Converts color indices to RGB coordinates. Color indices are long integers used in decomposed color in direct graphics where the lowest order byte value is the red value, the next byte is the green value, the next byte is the blue value, and the highest order byte value is unused.

Return value

bytarr(3) or bytarr(n, 3); string or strarr(n)


indices in required type=long or lonarr(n)

indices representing either a color or n colors


hex in optional type=boolean

set to return a string instead of a bytarr(3); string formatted according to HTML/CSS conventions: #RRGGBB


For example:

IDL> print, vis_index2rgb('ffff00'x) 0 255 255
Multiple colors can be converted at once:
IDL> colors = ['ffff00'x, 'ffffff'x, '0000ff'x, 'ff00ff'x] IDL> rgbColors = vis_index2rgb(colors) IDL> print, rgbColors 0 255 255 255 255 255 0 0 255 255 0 255 IDL> tvlct, rgbColors

File attributes

Modification date: Mon Nov 29 18:33:10 2010
Lines: 63
Docformat: rst rst