I like the idea, although I'd probably choose a palette of, say, 30 colors, and hash the username mod 30 to determine the color. That way all the colors should be sufficiently contrasty.
Sometimes it rolls a yahtzee and the three people talking all have the same color and the same length of chars in their name.
I figure that even if the people talking luck out and have a shade of green like in my screenshot, it's still better than if they all fell into the identical green bucket.
https://github.com/Zarel/Pokemon-Showdown-Client/blob/434322...
A naive HSL implementation will lead to very light yellows/cyans and very dark blues. PS corrects for this by manually darkening yellows/cyans and lightening blues.
A better solution might be to use a color model based on perceived luminance, like one discussed here: https://news.ycombinator.com/item?id=11437794