I'm not sure how to loop through color3 values. I want it to fade from green all the way back to green. I've achieved this in the past, but once again forgot what to do.
This is what I tried.
for i = 1,255 do something.BackgroundColor = Color3.new(0, i, 0) end
I know that it just goes up from black to green, but I don't even know where to start for that.
I am not sure how you want this to function but you might be better off using HSV.
This is a quick example of HSV a loop in a frame.
local runServ = game:GetService('RunService') local frame = script.Parent while true do for i=0, 1, 0.001 do -- loop through hue range frame.BackgroundColor3 = Color3.fromHSV(i, 0.5, 0.5) runServ.RenderStepped:Wait() end end
If you are looking for a differnt type of colour loop then you might be better off using the tween service or using the lerp function of the color3 roblox data type.
I hope this helps. please comment if you have any other questions.
I would suggest looking into the TweenService
if you're going to do more complex fading later but as for your script the problem is that the Color3 value expects a value from 0 to 1, This is your script but fixed:
for i = 1,255 do something.BackgroundColor = Color3.new(0, i/255, 0) end