ColorRGB()

Summary

Creates a color based on the amounts of red, green and blue.

Changes

In Version 6.0/2012 added optional alpha (opacity).

Syntax

c = ColorRGB(integer red, integer green, integer blue [, integer alpha])

Argument Contents
red The amount of red saturation, between 0 (minimum) and 65535 (maximum)
green The amount of green saturation, between 0 and 65535
blue The amount of blue saturation, between 0 and 65535
alpha The amount of opacity, from 0 (clear) to 65535 (completely opaque, the default)

Returns

A color (red, green, blue, and alpha).

Notes

  • Pure red with maximum brightness corresponds to (red = 65535, green = 0, blue = 0). Similarly for pure green and pure blue of maximum brightness.

  • Pure white corresponds to (red = 65535, green = 65535, blue = 65535).

  • Pure black corresponds to (red = 0, green = 0, blue = 0).

  • Opacity can also be set with the alpha selector on a color; for more information, see Compound Variables.

See Also

Function Summary
ColorHSV() Creates a color based on hue, saturation and brightness
ColorHLS() Creates a color based on hue, lightness and saturation
ColorCIE() Creates a color based on its (x, y, Y) coordinates in CIE chromaticity space