Rainbow UIStroke

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A UIStroke that is rainbow.

  2. What is the issue? Include screenshots / videos if possible!
    It is not working.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked at a post, but they had no solutions.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

function zigzag(X) return math.acos(math.cos(X*math.pi))/math.pi end

counter = 0

while wait(0.1) do
script.Parent.Color = Color3.fromHSV(zigzag(counter),1,1)
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
The UI not showing the correct border, randomly going to red below:

local counter = 0

while wait(0.1) do
	script.Parent.Color = Color3.fromHSV(counter,1,1)
	counter += 1/255
	if counter >= 1 then
		counter = 0
	end
end
local h = 0
while wait() do
	local c = Color3.fromHSV(h, 1, 1)
	script.Parent.Color = c
	h = (h + 0.005) % 1
end

To create a rainbow effect on the stroke, supply a UIGradient for the color ( UIStroke | Roblox Creator Documentation.

If you want a solid-color outline that strobes through the colors of the rainbow, your best option is a tween that repeats with a start color of something like violet, and an end color of yellow.

If you want a rainbow outline that is animated so the colors are shifting, use the RunService with a bind to render callback and keep supplying alternate gradiants (I don’t believe you can tween a gradient, but maybe you can?)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.