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

Color3 glitching out for some reason on just one textlabel?

So I'm making an IFE with a news page system of sorts. Photo is below https://gyazo.com/c86b60cd2d8f23a9998acf3b132c80c7

I want to make the dots in the corner change to a gray colour, here's my code.

local image1 = script.Parent.image1
local image2 = script.Parent.image2
local image3 = script.Parent.image3
local dot1 = script.Parent.dot1
local dot2 = script.Parent.dot2
local dot3 = script.Parent.dot3


wait(3)
print('starting')
image1:TweenPosition(UDim2.new(1.5, 0,0.018, 0), 'Out', 'Quint', 1, true)
image2:TweenPosition(UDim2.new(0.017, 0,0.018, 0), 'Out', 'Quint', 1, true)
wait(1)
dot2.TextColor3 = Color3.new(255,255,255)
dot1.TextColor3 = Color3.new(83,83,83)--This is what doesn't work.

Now the first dot is supposed to change to the colour (83,83,83) and the second to change to (255,255,255), but instead just dot2 actually changes to 255,255,255 and dot1 doesn't.Here's a picture of what I mean. https://gyazo.com/3f593f67822663e255c375e47dd6c2c4 Now the color3 dot1 changed to is 21165, 21165, 21165 despite me putting in 83,83,83. Why is this?

1 answer

Hello.

Solution:

You must use Color3.fromRGB() instead of Color3.new().

Recommendations:

  • Use Enums instead of strings.

Fixed Code:

local image1 = script.Parent.image1
local image2 = script.Parent.image2
local image3 = script.Parent.image3
local dot1 = script.Parent.dot1
local dot2 = script.Parent.dot2
local dot3 = script.Parent.dot3


wait(3)
print('starting')
image1:TweenPosition(UDim2.new(1.5, 0,0.018, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 1, true)
image2:TweenPosition(UDim2.new(0.017, 0,0.018, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 1, true)
wait(1)
dot2.TextColor3 = Color3.fromRGB(255,255,255)
dot1.TextColor3 = Color3.fromRGB(83,83,83)--This is what doesn't work.

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