I believe you have to fork the default chat scripts by copying the scripts on the client in runtime, then study the part responsible for the coloring of their username. It is not arbitrary and seems to have some logic implemented to it based on the name rather than UserId.
Here’s the script I used (if you or anyone else was wondering):
Extracted from ExtraDataInitializer
local module = {}
function module:GetNameColor(speaker)
NAME_COLORS =
{
Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
BrickColor.new("Bright violet").Color,
BrickColor.new("Bright orange").Color,
BrickColor.new("Bright yellow").Color,
BrickColor.new("Light reddish violet").Color,
BrickColor.new("Brick yellow").Color,
}
local function GetNameValue(pName)
local value = 0
for index = 1, #pName do
local cValue = string.byte(string.sub(pName, index, index))
local reverseIndex = #pName - index + 1
if #pName%2 == 1 then
reverseIndex = reverseIndex - 1
end
if reverseIndex%4 >= 2 then
cValue = -cValue
end
value = value + cValue
end
return value
end
local color_offset = 0
local function ComputeNameColor(pName)
return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
end
return ComputeNameColor(speaker.Name)
end
return module
-- This is better.
local Utilize = {}
-- Player Name Chat Colors
local NameColors = {
Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
BrickColor.new("Bright violet").Color,
BrickColor.new("Bright orange").Color,
BrickColor.new("Bright yellow").Color,
BrickColor.new("Light reddish violet").Color,
BrickColor.new("Brick yellow").Color,
}
-- Get Name Color
function Utilize.GetNameColor(Username)
local Value = 0
local NumName = #Username
for index = 1, NumName do
local CValue = string.byte(string.sub(Username, index, index))
local ReverseIndex = NumName - index + 1
if NumName % 2 == 1 then
ReverseIndex = ReverseIndex - 1
end
if ReverseIndex % 4 >= 2 then
CValue = -CValue
end
Value = Value + CValue
end
return NameColors[(Value % #NameColors) + 1]
end
return Utilize