3 ms·
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
by baddox 10y ago
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.
- danneu 10y agoMy IRC client does this, but I find it too jarring when multiple people are talking and they have the same color. 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.
- evan_ 10y agoIt could choose two or three colors and split the name in half or thirds.
- looki 10y agoI'd probably try to convert the RGB to HSV and then sanitize the values a bit. Get rid of too flashy or too unsaturated colors.
- Zarel 10y agoThis is what Pokémon Showdown does. https://github.com/Zarel/Pokemon-Showdown-Client/blob/434322fecce4deeec9533c4023f0273101055a80/js/battledata.js#L65-L108 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 https://news.ycombinator.com/item?id=11437794