Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[NOT A REQ]How to make a Frame smoothly change colors?

Asked by
JellyYn 70
7 years ago

I know how to make them randomly change colors, but not smoothly.. Any tips on how to make them smoothly change, or would I have to use multiple parts?

3 answers

Log in to vote
1
Answered by 7 years ago

Color3:lerp(Goal, Number)

example

1local oldFrameColor = Frame.BackgroundColor3
2local colorGoal = Color3.fromRGB(0,0,0)
3 
4for i = 0,1,0.05 do
5    Frame.BackgroundColor3 = oldFrameColor:lerp(colorGoal, i)
6    wait()
7end

https://wiki.roblox.com/index.php?title=API:Color3

Ad
Log in to vote
1
Answered by 7 years ago

:You can use a for loop to do this, for example:

1local color = script.Parent.BackgroundColor3
2for i = 1, 60 do
3    wait(0.1)
4    color = color + Color3.fromRGB(0, 0, 1)
5end
Log in to vote
0
Answered by 7 years ago

I Recommend This If You Want A Random Colour.

Just Make A TableLike This

1FrameColours = {"White","New Yeller","Candy Pink","Deep Orange"}

And Then Do A Little Script Like This

1local framecolour = script.parent.BackgroundColour3
2framecolour = math.random(FrameColours)
3wait (5)
4framecolour = math.random(FrameColours)

Note That The BackgroundColor3Varible Is Your Friend When Doing This

It's Not The Smoothest But You Can Edit This I Don't Expect Credit.

Answer this question