Page tree
Skip to end of metadata
Go to start of metadata

An array containing four elements: [red, green, blue, alpha]

The color components follow the standard RGB color model (see Web colors for some examples).
Their allowed range is between 0 and 1, where 1 is the equivalent of 255 in a hexadecimal representation (e.g. as used in image editing software or web colors).
The alpha value defines the transparency, where 0 is totally transparent, and 1 is fully opaque.

  • Solid black: [0,0,0,1] (000000 in hex)
  • White at 75% transparency: [1,1,1,0.25] (FFFFFF in hex)
  • Solid red: [1,0,0,1] (FF0000 in hex)
  • Semi-transparent orange: [1,0.5,0,0.5] (FF8000 in hex)

Scripts

In scripts, colors are defined as a regular array (with square brackets), e.g.

_blue = [0,0,1,1];
player displayText ["blue", [0,0,2], true, _blue, 1.5, 2];

See also: fn vbs colorByName, setObjectTexture 

Addons & Dialogs

In addons or dialogs, any arrays (including color arrays) are defined via curled brackets, e.g.

colorBackground[] = {.2, .2, .2, .8};