Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by
JellyYn 70
1 year 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 1 year ago

Color3:lerp(Goal, Number)

example

local oldFrameColor = Frame.BackgroundColor3
local colorGoal = Color3.fromRGB(0,0,0)

for i = 0,1,0.05 do
    Frame.BackgroundColor3 = oldFrameColor:lerp(colorGoal, i)
    wait()
end

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

Ad
Log in to vote
1
Answered by 1 year ago

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

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

I Recommend This If You Want A Random Colour.

Just Make A TableLike This

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

And Then Do A Little Script Like This

local framecolour = script.parent.BackgroundColour3
framecolour = math.random(FrameColours)
wait (5)
framecolour = 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