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

How do i make smooth color3 go from white to black?

script.Parent.TextColor3 = Color3.fromRGB(149, 149, 0)
wait(0.3)
script.Parent.TextColor3 = Color3.fromRGB(107, 107, 0)
wait(0.3)
script.Parent.TextColor3 = Color3.fromRGB(61, 61, 0)
wait(0.3)
script.Parent.TextColor3 = Color3.fromRGB(0, 0, 0)

Can't make it smooth, i dont know how to smooth change Color3

1 comment

0

please give more description why do you want it

2 answers

✓ Accepted answer

Looks like what you need is a loop. You can use a for-loop with wait in it (because loops try to execute in one frame, so you'll need tell it that you want it to do it slowly) to decrement the red, green, and blue of the color every frame until they are equal to 0. Also, (255, 255, 255) is white, while (0, 0, 0) is black. So simply do

for (i = 255, 0, -1)
	script.Parent.TextColor3 = Color3.fromRGB(i, i, i)
	wait()
end

Hello. Use TweenService to do that.

local TweenService = game:GetService("TweenService")
local TweenInformation = TweenInfo.new(
	0.3, -- Time to complete the tween
	Enum.EasingStyle.Linear, -- Easing Style
	Enum.EasingDirection.InOut, -- Easing Direction
	0, -- Repeat count
	false, -- Reverses to default color after the tween is finished?
	0 -- Delay between each tween
	
)
local GoalsWhite = { -- Properties table
	Color = Color3.fromRGB(255,255,255) -- White
}
local GoalsBlack = {
	Color = Color3.fromRGB(17,17,17) -- Black
}

local TweenToWhite = TweenService:Create(script.Parent,TweenInformation,GoalsWhite) -- Creates the tween that can be played.
local TweenToBlack = TweenService:Create(script.Parent,TweenInformation,GoalsBlack)
-- Current part color is White so we will tween it to black.

while true do -- We will create a while loop to tween it every 1 second.
	TweenToBlack:Play()
	wait(1)
	TweenToWhite:Play()
	wait(1)
end

NOTE: This is for Parts. If you want to tween a Frame/Button/TextBox/TextLabel etc.. replace Color in the properties table with BackgroundColor3 / TextColor3, depending on what you want to change.

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