I have an AJAX chat system that I'm working on and so far I have it working. One thing I want to do is have it so when the user name is displayed on screen, it is a unique color (like in an AIM window). How would I generate a random color to assign to the user's name for the particular session they are logged in for?
The color would have to be something that is darker as it on white background and as they are generated, they can't be too similar to the colors that other current users have been assigned.
EDIT Thanks, I guess a predefined list would be the easiest way. If I have this list in a config file and I assign a color when the user logs in, how should I go about making sure that no two logged in users have the same color?