Color3

< Scripting | Data Types

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.

Constructor Description
Color3.new() Creates a new Color3 for black (0,0,0).
Color3.new(number r, number g, number b) Creates a new Color3 using RGB values from 0 to 1.
Color3.fromRGB(number r, number g, number b) Creates a new Color3 using integer values from 0 to 255.
Color3.fromHSV(number h, number s, number v) Creates a new Color3 using HSV values from 0 to 1.

Static Methods[edit]

Function Description
Color3.toHSV(Color3 color) Returns the HSV representation of a Color3 as 3 numbers (with values between 0-1)

Properties[edit]

Property Type Description
Color3.r number The red value from 0 to 1
Color3.g number The green value from 0 to 1
Color3.b number The blue value from 0 to 1

Methods[edit]

Member Function Description
Color3:lerp(Color3 goal, number alpha) 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]

BrickColor