Trying to store a Color3.fromRGB as an array

local Part = script.Parent
local color = {200, 100, 100}

Part.Color = Color3.fromRGB(color)

I am trying to get a part to gradually change from one color to another using arrays. I am using arrays because it allows me to perform math equations to change colors at very small intervals.

I am running into an error “Invalid arguments to Color3 constructor” which changes the part to black. I can’t figure out what’s going wrong, but I’m assuming it has to do with the color variable being an array.

You have to use unpack on the table.

Part.Color = Color3.fromRGB(unpack(color))
1 Like

This fixed it, I appreciate your help.

1 Like

Can you show what you have? It should still work

1 Like

I found that there was an unrelated issue resulting in some other data not being properly obtained, it works just fine!

1 Like