M MY Multiplayer: Wiki
Side
Kind

tocolor

Shared

Packs a colour's components into a single ARGB number. It is the same function as rgb.

int tocolor(int red, int green, int blue [, int alpha = 255])

Parameters

NameTypeDescription
redintThe red, from 0 to 255.
greenintThe green, from 0 to 255.
blueintThe blue, from 0 to 255.
alphaintThe opacity, from 0 to 255.default 255

Returns

The colour as a number. If an argument is not an integer, opaque black.

Values outside 0 to 255 are clamped.

Example

dxDrawRectangle(10, 10, 200, 40, tocolor(0, 0, 0, 160))

See also