Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How i make a gui color transiction smoother?

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

4 comments

0

you can just use Color3.fromRGB() so you don't have to convert them to 1 - 0 numbers

0

You could use :lerp()

0

@kingblaze_1000 i did it all set but now gui.Position not working

1

use TweenService

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.