🎨 Color
A color composed of components (R, G, B, A) with floating point precision.
🧑💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
🎒 Examples
local grey_color = Color(0.5, 0.5, 0.5, 1)
🛠 Constructors
Default Constructor
local my_color = Color(R?, G?, B?, A?)
Type | Name | Default | Description |
---|---|---|---|
number | R | 0 | Red color percentage (0-1) |
number | G | X | Green color percentage (0-1) |
number | B | X | Blue color percentage (0-1) |
number | A | 1 | Alpha transparency percentage (0-1) |
🧽 Properties
Type | Name | Description |
---|---|---|
number | R | Red color percentage (0-1) |
number | G | Green color percentage (0-1) |
number | B | Blue color percentage (0-1) |
number | A | Alpha transparency percentage (0-1) |
🦠 Functions
info
This structure supports +
, -
, *
, /
, ==
, and tostring
operations.
ToHex
Gets the Hexadecimal representation of this Color
— Returns string (Hexadecimal representation of this Color).
local ret = my_color:ToHex(appends_transparency?)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | appends_transparency? | true | Appends transparency part |
🗼 Static Properties
Value | Name |
---|---|
Color(1, 1, 1) | Color.WHITE |
Color(0, 0, 0) | Color.BLACK |
Color(0, 0, 0, 0) | Color.TRANSPARENT |
Color(1, 0, 0) | Color.RED |
Color(0, 1, 0) | Color.GREEN |
Color(0, 0, 1) | Color.BLUE |
Color(1, 1, 0) | Color.YELLOW |
Color(0, 1, 1) | Color.CYAN |
Color(1, 0, 1) | Color.MAGENTA |
Color(1, 0.5, 0) | Color.ORANGE |
Color(0.5, 1, 1) | Color.CHARTREUSE |
Color(0, 1, 0.5) | Color.AQUAMARINE |
Color(0, 0.5, 1) | Color.AZURE |
Color(0.5, 0, 1) | Color.VIOLET |
Color(1, 0, 0.5) | Color.ROSE |