Need help with color tween

How do I smoothly tween a color?
(I mostly want to know how to do it with UI)

4 Likes

Hello, you can use TweenService like you would with any other object.

Please see TweenService:Create() and TweenInfo

I’ll change the Button with a TweenInfo(3) which means duration 3 and it will use the Goal table, which changes BackgroundColor3 to Color3.new(255, 0, 0) which is RED.

local TweeenService = game:GetService("TweenService")
local Button = script.Parent	
local Goal = {BackgroundColor3 = Color3.new(255, 0, 0)}
--Set the tween:
local Tween = TweeenService:Create(Button, TweenInfo.new(3), Goal)

Button.MouseButton1Click:Connect(function()
	Tween:Play()
end)

15 Likes
local TweenService = game.TweenService -- Variable for tweenservice
 local Tween = TweenService:Create(Instance,TweenInfo.new(parameters),{Color = Color3.FromRGB(R,G,B) --Create Color Tween
Tween:Play() --Play The Tween

Adjust.

3 Likes