0

In my application I have a chat service.

And as with chat, there are many users with different nicks, and I would like to have each nick with different color. So, are there any javascript algorithms which can convert a string (nick) to a RGB value? I was thinking about, idk, getting ascii value of each character, adding them together, and then somehow converting it to three hex values? Or something similar? Does anyone have any ideas on how to approach it?

4
  • 2
    "I was thinking about, idk, getting ascii value of each character..." - So why don't you try that?
    – nnnnnn
    Commented Dec 5, 2013 at 20:41
  • @nnnnnn: Because maybe someone already implemented something similar, and is willing to share his solution with me?
    – ojek
    Commented Dec 5, 2013 at 20:42
  • 1
    Looks like a number of other people have done exactly what you describe. Try something out, like @nnnnnn said, or do some research you oldbie (said as lovingly as possible)!!
    – admdrew
    Commented Dec 5, 2013 at 20:43
  • @admdrew: Yeah, there are some solutions there, thanks!
    – ojek
    Commented Dec 5, 2013 at 20:46

0

Browse other questions tagged or ask your own question.