Is there a built-in method to get individual RGB values of a Color3?

Hello!

I was wondering how I would get individual RGB values, I have created a function that goes something like this:

local c = Color3.fromRGB(123, 123, 123)

local stringSplit = string.split(tostring(c), ',')
local r = stringSplit[1]
local g = stringSplit[2]
local b = stringSplit[3]

It works, but is there a more effective method?

1 Like
local c = Color3.fromRGB(0,0,0)
print(c.R)
print(c.G)
print(c.B)

This will print 0

1 Like

There’s a R, B and B property for Color 3: Color3.R, Color3.G, Color3.B

local c = Color3.fromRGB(123, 123, 123)
print(c.R) --> 123
1 Like