color Module
Predefined Colors
The color
module provides two sets of predefined color constants:
color constants by color, and color constants by purpose.
The predefined color constants by color (represented here as HTML color codes) are as follows:
Constant |
Color |
---|---|
|
#FFFFFF |
|
#000000 |
|
#FF0000 |
|
#00FF00 |
|
#0000FF |
The predefined color constants by purpose are as follows:
Constant |
Color |
Purpose |
---|---|---|
|
#FFFFFF |
Welcome messages displayed to player at login. |
|
#D20000 |
Alerts and error messages displayed in chat. |
|
#B3B3B3 |
Local chat messages. |
|
#FFFFFF |
Global chat messages. |
|
#808080 |
System chat messages. |
Color Functions
Rgb(r, g, b)
Definition
- color.Rgb(r, g, b)
Creates a color with the given red, green, and blue components. The alpha component is set to 255.
- Parameters:
r (
integer
) – Red component.g (
integer
) – Green component.b (
integer
) – Blue component.
- Returns:
Color.
- Return type:
integer
Example
Rgb(r, g, b)
to define a color.local white = color.Rgb(255, 255, 255)
Rgba(r, g, b, a)
Definition
- color.Rgba(r, g, b, a)
Creates a color with the given red, green, blue, and alpha components.
- Parameters:
r (
integer
) – Red component.g (
integer
) – Green component.b (
integer
) – Blue component.a (
integer
) – Alpha component.
- Returns:
Color.
- Return type:
integer
Example
Rgba(r, g, b, a)
to define a color.local transparentRed = color.Rgba(255, 0, 0, 160)