Color3

< Global namespace | ROBLOX namespace

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[edit]

These Constructors are used for creating Color3 values.


Color3.new[edit]

Color3 Color3.new(Script error)

Description:
Creates a Color3 whose values are (0,0,0) [black]


Color3 Color3.new(Script error)

Description:
Creates a new Color3 using RGB values between 0 and 1.


Color3.fromRGB[edit]

Color3 Color3.fromRGB(Script error)

Description:
Creates a new Color3 using RGB integer values between 0 and 255.


Color3.fromHSV[edit]

Color3 Color3.fromHSV(Script error)

Description:
Creates a new Color3 using HSV values from 0 to 1.


Static Methods[edit]

These methods are not present under a constructed Color3 object, but they don't construct a Color3 either.


Color3.toHSV[edit]

number, number, number Color3.toHSV(Script error)

Description:
Returns the HSV representation of a Color3 as 3 numbers (with values between 0-1)


Properties[edit]


r[edit]

number Color3.r [readonly]

Description:
The R component of the Color3's RGB channels, as a number between 0 and 1.


g[edit]

number Color3.g [readonly]

Description:
The G component of the Color3's RGB channels, as a number between 0 and 1.


b[edit]

number Color3.b [readonly]

Description:
The B component of the Color3's RGB channels, as a number between 0 and 1.


Methods[edit]


lerp[edit]

Color3 Color3:lerp(Script error)

Description:
Returns a Color3 interpolated between this Color3 and the goal by the fraction alpha.


Converting BrickColor in to Color3[edit]

You can easily convert your BrickColor into Color3 format by simply doing something like this!

local brickcolor = BrickColor.new("Really red") --Create our new BrickColor
local color = brickcolor.Color --BrickColors have a Color property that returns their Color3

See Also[edit]