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

Script Setting GUI TextColor3 to 19380, 62985, 65025 instead of 76, 247, 255?

Okay so I am having a problem where my script will work at changing the text color to red, but when it tries to change it back to blue it doesn't set it back to blue, it sets it to white. The color code that it gets changed to instead of 76, 247, 255 is 19380, 62985, 65025.

local length = string.len("11223344556677889911223344556677889911223344556677889911223344556");
if length == nil then
	length = 65;
end;

while wait(0.01) do
	if string.len(script.Parent.Text) > length then
		script.Parent.TextColor3 = Color3.new(255, 0, 0);
	else
		script.Parent.TextColor3 = Color3.new(76, 247, 255);
	end;
end;

1 answer

✓ Accepted answer

Color3 Values that are not 0 or 255 must be divided by 255:

local length = string.len("11223344556677889911223344556677889911223344556677889911223344556");
if length == nil then
    length = 65;
end;

while wait(0.01) do
    if string.len(script.Parent.Text) > length then
        script.Parent.TextColor3 = Color3.new(255, 0, 0);
    else
        script.Parent.TextColor3 = Color3.new(76/255, 247/255, 255);
    end;
end;

3 comments

2

...all values should be in the range [0,1]. I'm not sure why 255 would work to mean 1. It should be Color3.new(1, 0, 0)

0

It does.

0

Thanks. BlueTaslem, the reason it works is because it's saying that 76/255 is a fraction out of 255 where 255 is the denumerator (Bottom of the fraction) and 76 is the numerator (top of the fraction) and 76 divided by 255 is 0.298039216.

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