Answered by
8 years ago Edited 8 years ago
Color3 is not Vector3; it is not a math object. So you can't do math with it, and hopefully you do not have to . . .
Here, since you simply go from white to black, you should make use of the "i" in the loop.
3 | Gui.BackgroundColor 3 = Color 3. fromRGB(i,i,i) |
However in more complex situations you are almost always need to use lerp. It would look like this.
2 | local original = Color 3. new( 1 , 1 , 1 ) |
3 | local goal = Color 3. new( 0 , 0 , 0 ) |
8 | gui.BackgroundColor 3 = original:lerp(goal,i) |
Lastly, if you really have to do actual math with the RGB values, which should be a last resort, simply take them out! i.e. Vector3.new(color.r, color.g, color.b)
Hope I helped!