A real-valued RGB color tuple, with elements ranging from [0,1]. The Color3 data type is often used in setting the colors of objects that aren't related to bricks, such as GUIs, Sparkles, etc.
Constructors | |
---|---|
Syntax | Description |
Color3.fromHSV(number hue, number sat, number val) | Creates a new Color3 using HSV values from 0 to 1. |
Color3.fromRGB(int r, int g, int b) | Creates a new Color3 using RGB integer values between 0 and 255. |
Color3.new(number r, number g, number b) | Creates a new Color3 using RGB values between 0 and 1. |
Color3.new() | Creates a Color3 whose values are (0,0,0) [black] |
Color3.toHSV(Color3 color) | Returns the HSV representation of a Color3 as 3 numbers (with values between 0-1) |
Properties | |
Syntax | Description |
number b | The B component of the Color3's RGB channels, as a number between 0 and 1. |
number g | The G component of the Color3's RGB channels, as a number between 0 and 1. |
number r | The R component of the Color3's RGB channels, as a number between 0 and 1. |
Functions | |
Syntax | Description |
Color3 Color3:lerp(Color3 goal, number alpha) | Returns a Color3 interpolated between this Color3 and the goal by the fraction alpha. |
These Constructors are used for creating Color3 values.
Color3 Color3.new()
Description:
Creates a Color3 whose values are (0,0,0) [black]
Color3 Color3.new(number r, number g, number b)
Description:
Creates a new Color3 using RGB values between 0 and 1.
Color3 Color3.fromRGB(int r, int g, int b)
Description:
Creates a new Color3 using RGB integer values between 0 and 255.
Color3 Color3.fromHSV(number hue, number sat, number val)
Description:
Creates a new Color3 using HSV values from 0 to 1.
number, number, number Color3.toHSV(Color3 color)
Description:
Returns the HSV representation of a Color3 as 3 numbers (with values between 0-1)
number Color3.r [readonly]
Description:
The R component of the Color3's RGB channels, as a number between 0 and 1.
number Color3.g [readonly]
Description:
The G component of the Color3's RGB channels, as a number between 0 and 1.
number Color3.b [readonly]
Description:
The B component of the Color3's RGB channels, as a number between 0 and 1.
Color3 Color3:lerp(Color3 goal, number alpha)
Description:
Returns a Color3 interpolated between this Color3 and the goal by the fraction alpha.
You can easily convert your BrickColor into Color3 format by simply doing something like this!