hangups
hangups copied to clipboard
Apply random colours to usernames
Apply random colours to usernames in the message list to improve readability (similar to clients like Pidgin).
I've done this in another app by selecting 26 (arbitrary) different colors and then use the remainder of user_id / 26
as the index for the color.
This gives reproducible colors to each user to keep consistency :)
ps. cache the results to avoid repeating this operation