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

How do I change a TextLabel's color?

I tried this:

script.Parent.TextColor3 = 255, 0, 0

I also tried:

script.Parent.TextColor3 = Vector3.new(255, 0, 0)

Any ideas?

1 answer

Colors are Color3s. They are constructed with the Color3 constructor, Color.new(r,g,b).

Note that the R, G, and B values are from 0 to 1 as opposed to 0 to 255, so, for example, what the properties tab shows as 192 is actually (approximately) 0.75.


The Wiki would have described this to you:

From TextLabel,

Color3 TextColor3


In a tangentially related note, the first line you indicated is obviously wrong because the comma (,) is used to separate multiple assignments:

one, two = 1, 2

print(one); -- 1
print(two); -- 2

Which would mean you were only assigning the first value (R) to the color and throwing out the other ones.

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