I'm a noob at scripting but i'm trying to make a Frame that will switch between the rainbow colors smoothly, not like just flashing the colors of the rainbow. Do I have to script all of the RGB colors manually or is there a more efficient way of doing it. Are there any references I can use?
Color3 has a function called fromHSV which takes the hue, saturation, and value as arguments, and converts them to a Color3. You can use a for loop to rotate through all the hues of the rainbow with as much precision as you want.
for hue=0, 1, 1/30 do frame.BackgroundColor3 = Color3.fromHSV(hue, 1, 1) wait() end
Another useful method of Color3s is the lerp method, which lets you smoothly transition between two colors. Unfortunately this will not necessarily retain the saturation and value along the way, but it can still be useful.
local color1 = Color3.new(1, 0, 0) --red local color2 = Color3.new(0, 1, 1) --cyan for t = 0, 1, 1/30 do whatever.BackgroundColor3 = color1:lerp(color2, t) end