Color3 in parts operates the RGB way.
@StrongBigeMan9 already explained RGB here, I suggest reading their post if you want an explanation of how RGB works, they explained it way better than I can.
Basically, if you want to change the color3 of a part, do this:
script.Parent.Color = Color3.fromRGB(0, 255, 0)
So your script should look like this:
while true do
script.Parent.Color = Color3.new(255,0,0)
wait(1)
script.Parent.Color = Color3.new(0,255,0)
wait(1)
end