The CT_LUMINANCE function calculates the luminance of colors.

This routine is written in the IDL language. Its source code can be found in the file ct_luminance.pro in the lib subdirectory of the IDL distribution.

Syntax


Result = CT_LUMINANCE( [R, G, B] [, BRIGHT=variable] [, DARK=variable] [, /READ_TABLES] )

Return Value


The function returns an array containing the luminance values of the specified colors. If the R, G, and B parameters are not specified, or if R is of integer, byte or long type, the result is a longword array with the same number of elements as the input arguments. Otherwise, the result is a floating-point array with the same number of elements as the input arguments.

Arguments


R

An array representing the red color table. If omitted, the color values from either the COLORS common block, or the current color table are used.

G

An array representing the green color table. This parameter is optional.

B

An array representing the blue color table. This parameter is optional.

Keywords


BRIGHT

Set this keyword to a named variable in which the array index of the brightest color is returned.

DARK

Set this keyword to a named variable in which the array index of the darkest color is returned.

READ_TABLES

Set this keyword, and don’t specify the R, G, and B arguments, to read colors directly from the current colortable (using TVLCT, /GET) instead of using the COLORS common block.

Version History


Pre 4.0

Introduced

See Also


GAMMA_CT, STRETCH