local part = script.Parent;
local R = math.random(1,255);
local G = math.random(1,255);
local B = math.random(1,255);
part.Color = Color3.fromRGB(R, G, B)
The RGB spectrum on Roblox only consists of values from 0 to 255, which will be plugged into a property of the BasePart. There are multiple ways to introduce color to a part, here is the documentation for it.