On the left is the old legacy chat, and on the right is TextChatService.
Roblox has introduced the new TextChatService as the default chat interface in new experiences, gradually phasing out the legacy chat version (formerly known as the “Lua Chat System”).
One minor change with the new chat is that for the default name colors every player has, the “Bright violet” BrickColor was changed to “Alder” as you can see above with the Player2 name.
Chat name colors are a curiously unexamined remnant of classic Roblox which remains in almost every experience on the platform today.
I’ve noticed many people are under the impression that these name colors are picked randomly when you change your username. My friend told me he had spent over 10,000 Robux changing his name because he wanted the right color.
The color is not decided randomly, and it is also not selected & stored on Roblox servers when you change your name. It’s easiest to think about it like a Minecraft world seed. It seems random, and that’s because it’s designed to feel that way. However, the world you spawn in will always be the same when you give it the same seed. It’s an algorithm.
The same is true of your Roblox chat name color. Your username is the input (the ‘seed’), and the color is the output. This name color algorithm is run every time you enter a chat message, not when you change your name. As long as the username is the same, the name color will not change.
You can check the color of any username, even before someone has taken it. Here’s an example experience for just that:
Someone should create browsing this thread made a web app to do this.
If you try looking up how Roblox decides your name color, you will always stumble upon this excerpt of code:
The nitpicker inside of me always deletes the color_offset
variable and its reference, because it’s zero and so it does nothing.
The important part of this code is the function GetNameValue
. This is where it picks the ‘random’ number associated with the name, taking into account the internally assigned values associated with the individual characters used (whether there’s a letter P or a letter R, for example). It also considers the number of characters in the name. GetNameValue
does some math using these two types of measurements on the name, and then spits out a new number. The function ComputeNameColor
then uses that ‘random’ number to pick from a list of eight colors.
That code has never changed since Roblox started using it in 2006, but some of the colors themselves have changed:
As a side note, I put Player7 and Player8 at the start because that shows the colors in the same order as they appear in the list from the code above
The RGB color is the only type of color you ever see in the chat, but the BrickColor value seems relevant enough to include in the graphic because that’s how they were decided originally and also how Alder was decided on recently.
You can see evidence of those darker red and blue name colors in this very old video @ 2:05:
There’s the dark green name color in this even older video @ 6:19:
These colors were used as late as 2014 (6:53):
but sometime in 2015 the dark green, blue and red were changed (9:52):
I modified the code excerpt from above so it has these different iterations of colors. You can use it here:
How to use:
- Require the module. It will return a function.
- Call the function with a name (string) input argument to get that name’s color.
- You can add a second argument to specify the version or era that you want for the chat name colors
- As of 2023, there are three total versions: 1, 2, and 3; from earliest to latest (2006, 2015, 2023)
- If no second argument is provided, the latest version is used
- You can add a second argument to specify the version or era that you want for the chat name colors
Here’s a barebones example usage:
local getNameColor = require(game.ReplicatedStorage:WaitForChild("GetNameColor"))
workspace.Baseplate.Color = getNameColor("GFink")
workspace.Baseplate.Color = getNameColor("GFink", 1)
Here are the different versions in action (in order 1 → 2 → 3), tested on a bunch of bricks with the input usernames labeled:
Hope this bit of trivia was interesting! Reply to this post if you notice mistakes, have suggestions, or want to provide additional information.