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

How i make a gui color transiction smoother?

Asked by
Zypsoh 25
4 years ago

Hi i have a gui and i want to make the color change, like a rgb and i want it to change the color smoother.

https://gyazo.com/255afc4256959426d73df753e785957b



while true do wait(2) script.Parent.BackgroundColor3=Color3.new(1, 153/255, 102/255) wait(2) script.Parent.BackgroundColor3=Color3.new(0, 102/255,1) wait(2) script.Parent.BackgroundColor3=Color3.new(0, 153/255, 0) wait(2) script.Parent.BackgroundColor3=Color3.new(204/255, 0, 153/255) wait(2) script.Parent.BackgroundColor3=Color3.new(1, 1, 0) wait(2) script.Parent.BackgroundColor3=Color3.new(102/255, 51/255, 0) wait(2) script.Parent.BackgroundColor3=Color3.new(0, 0, 0) wait(2) script.Parent.BackgroundColor3=Color3.new(248/255, 248/255, 248/255) wait(2) script.Parent.BackgroundColor3=Color3.new(119/255, 119/255, 119/255) wait(.5) script.Parent.BackgroundColor3=Color3.new(102/255, 255/255, 204/255) end
0
you can just use Color3.fromRGB() so you don't have to convert them to 1 - 0 numbers Luka_Gaming07 534 — 4y
0
You could use :lerp() kingblaze_1000 359 — 4y
0
@kingblaze_1000 i did it all set but now gui.Position not working Zypsoh 25 — 4y
1
use TweenService Mr_m12Ck53 105 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Hello. You can use TweenService to help. Try this:

local TweenService = game:GetService("TweenService")

local info = TweenInfo.new(
    4, -- Time
    Enum.EasingStyle.Sine, -- EasingStyle
    Enum.EasingDirection.Out -- EasingDirection
)

local propertyTable = {BackgroundColor3 = Color3.new(102/255, 255/255, 204/255)}

local tween = TweenService:Create(script.Parent, info, propertyTable)

tween:Play()

TweenService:Create() requires three things. The instance, TweenInfo, and propertyTable.

Please accept and upvote this answer if it helped.

Ad

Answer this question