How to loop gradients like this


example provided in video. (shifting gradient loop)

2 Likes
1 Like

how do I make it shift tho, like the gradient will go from right to left then loop again

1 Like
local UIGradient = --Your gradient here

while true do
task.wait()
UIGradient.Color = ColorSequence.new({
    ColorSequenceKeypoint.new(0, Color3.new(1,0,0)),
    ColorSequenceKeypoint.new(0.5, Color3.new(0,1,0)),
    ColorSequenceKeypoint.new(1, Color3.new(0,0,1))
})
end
1 Like

I dont understand how to change the color (like two colors and tri colors, also rainbow)

UI gradients use color sequences for their color (basically multiple keypoints, where you can decide the number of keypoints and their color).

Would’nt this make it the same gradient every time the loop runs?

his message prob tell me to make the colorsequence updating system myself

Based off the type of animation, it looks like it was setup with something like this:

Then I had a script to move the color frame from one end to another in a loop:

example.rbxm (6.3 KB)

is it possible to do it without canvasgroup? its because that much canvasgroup might lag the client I think? :thinking:, and how to use it for tri colors

you could do it through interpolation, using the Lerp function you can lerp keypoints in a color gradient

Dunno much about canvasgroups, but I’m pretty sure you could add as many colors as you want to the same frame? To achieve the tri color thing

You can use a Frame if you don’t mind not having the UICorners. Otherwise, it’s likely possible but requires writing your own function to calculate keypoints at a certain alpha.

it seem like the color duration for reversing is too long :rofl:

Had the same problem a while back:

feeling dizzy reading the code lmao