Hash string into RGB color
A good hash function will provide a near uniform distribution over the key space. This reduces the question to how do I convert a random 32 bit number to a 3 byte RGB space. I see nothing wrong with just taking the low 3 bytes. int hash = string.getHashCode(); int r = (hash & 0xFF0000) … Read more