RGBToInt

Prototype

Matrix RGBToInt( Matrix mRGB )

Return Value

The return value is a numeric vector containing integer color values corresponding to the RGB component values in the matrix mRGB.

Parameters

Matrix mRGB
An (n x 3) numeric matrix of integers in the range [0, 255]. Each row specifies a color. The first column specifies the color's red component, the second column specifies the color's green component, and the third column specifies the color's blue component.

Remarks

This module converts a matrix of RGB component values to integer color values. Each element in the return vector is an integer color value whose hexadecimal representation is in the form 00rrggbbX, where rr specifies the color's red component (00–FF hexadecimal), gg specifies the color's green component (00–FF hexadecimal), and bb specifies the color's blue component (00–FF hexadecimal).

Example
RGB = { 255   0   0, /* red       */
        255 128   0, /* orange    */
          0 128 128, /* teal      */
        128 128 255, /* lavender  */
        255   0 128, /* rose      */
        128 128 128  /* dark grey */
      };
colors = RGBToInt( RGB );
print colors[format=hex6.];
See Also

IntToRGB