BrickColor
Overview
Description
BrickColor
is an object used to define and work with color data. It is mainly utilized in rendering or handling specific colors in the user interface.
Properties
number
number
This property is the unique identifier number for the color value associated with the BrickColor
object. It allows for easy reference during the creation of colors.
Code Samples
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)
local BrickColorIndex = BrickColor.Number
print(BrickColorName, "(", BrickColorIndex, ") : ", BrickColor.r, BrickColor.g, BrickColor.b)
r
number
This property is the Red (R) component value of the current BrickColor
. The value is a floating-point number between 0 and 1.
Code Samples
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)
print(BrickColor.r)
g
number
This property is the Green (G) component value of the current BrickColor
. The value is a floating-point number between 0 and 1.
Code Samples
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)
print(BrickColor.g)
b
number
This property is the Blue (B) component value of the current BrickColor
. The value is a floating-point number between 0 and 1.
Code Samples
local BrickColorName = "Bright red"
local BrickColor = BrickColor.new(BrickColorName)
print(BrickColor.b)
Name
string
Represents the name of the color that corresponds to the BrickColor
. It is returned as a string
value.
Code Samples
local BrickColor = BrickColor.new("Bright red")
local BrickColorName = BrickColor.Name
print(BrickColorName)
Color
Represents the BrickColor
to a corresponding Color3
object.
Code Samples
local BrickColor = BrickColor.new("Bright red")
local Color3 = BrickColor.Color
print(Color3.r, Color3.g, Color3.b)
Constructors
new
Creates a new BrickColor
object.
Parameters
string
val
The name or ID of the color. Example: "Bright red".
Return
BrickColor
The created BrickColor object.
Code Samples
local BrickColor = BrickColor.new("Bright red")
Methods
Last updated