M MY Multiplayer: Wiki
Side
Kind

rgb

Shared

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

int rgb(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

local orange = rgb(255, 140, 0)
setSunColor(orange)

See also