Why this color is wrong

this is the script

local open = script.Parent.Parent.Parent.Open
local buttonFrame = script.Parent.Parent.Parent
local text = script.Parent.Parent.TextLabel
local background = script.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if open.Value == false then

	open.Value = true
	
	buttonFrame:TweenSize(UDim2.new(0.23, 0,0.109, 0), Enum.EasingDirection.In,Enum.EasingStyle.Linear, 0.1 ,true)
	text.TextColor3 = Color3.new(0, 0, 0)
	background.ImageColor3 = Color3.new(255, 236, 21)
else
	open.Value = false
	
	buttonFrame:TweenSize(UDim2.new(0.21, 0,0.089, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear, 0.1 ,true)
	text.TextColor3 = Color3.new(227, 210, 18)
	background.ImageColor3 = Color3.new(144, 84, 0)
	
end

end)

i dont know why it turned to the wrong color

Try to use:

text.TextColor3 = Color3.fromRGB(227, 210, 18) --fromRGB

Instead of

Color3.new(227, 210, 18)
4 Likes

If you’re willing to use Color3.new with values that go from 0 all the way up to 255, make sure to divide each of them by 255 since it only takes values from 0 to 1 unlike Color3.fromRGB

2 Likes