I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000#000000
and #FFFFFF#FFFFFF
, so I can use it as a colour for a HTML element.
Maybe even a shorthand hex value (i.e.g: #FFF#FFF
) if that's less complicated. In fact, a colour from a 'web-safe' palette would be ideal.
I've had a look on the site and there were some similar questions for RoR and Java, but they didn't look too transferable. Having said that I'm not that familiar with the finer points of JavaScript.