Color3
Last updated
Color3 combines the three elements of RGB in ratio form to express a color, with each channel ranging from 0 to 1.
Unlike BrickColor, which selects predefined color names, Color3 can be used to directly adjust the desired color with numerical values. It is therefore used to set the color palette of a part or GUI element in detail.
Combines the input RGB values to create and return a new Color3 color object.
number red
A value representing the Red ratio in the RGB color system, ranging from 0 to 255.
number green
A value representing the Green ratio in the RGB color system, ranging from 0 to 255.
number blue
A value representing the Blue ratio in the RGB color system, ranging from 0 to 255.
Color3
The created Color3.
local RGB = Color3.fromRGB(255, 10, 50)
print(RGB.R, RGB.G, RGB.B)Combines the input RGB ratios to create and return a new Color3 color object.
number red
A value representing the Red ratio in the RGB color system. 0 means the intensity of Red is very low, and 1 means the intensity of Red is very high.
number green
A value representing the Green ratio in the RGB color system. 0 means the intensity of Green is very low, and 1 means the intensity of Green is very high.
number blue
A value representing the Blue ratio in the RGB color system. 0 means the intensity of Blue is very low, and 1 means the intensity of Blue is very high.
Color3
The created Color3.
number
A value representing the Blue ratio of Color3 in the RGB color system. 0 means the intensity of Blue is very low, and 1 means the intensity of Blue is very high.
number
A value representing the Green ratio of Color3 in the RGB color system. 0 means the intensity of Green is very low, and 1 means the intensity of Green is very high.
number
A value representing the Red ratio of Color3 in the RGB color system. 0 means the intensity of Red is very low, and 1 means the intensity of Red is very high.
Last updated
local Color = Color3.new(0.5, 0, 0)local Color = Color3.new(0, 0, 0.5)
print(Color.B)local Color = Color3.new(0, 0.5, 0)
print(Color.G)local Color = Color3.new(0.5, 0, 0)
print(Color.R)