title: Python - Get random color, given a seed number as fast as possible
body: <p>I need to find a random color, given a specific seed number - fast.
  given the same ID twice, should return the same color.</p>
  
  <p>I did this:</p>
  
  <pre><code>def id_to_random_color(number):
      random_bytes = hashlib.sha1(bytes(number)).digest()
      return [int(random_bytes[-1]) / 255, int(random_bytes[-2]) / 255, int(random_bytes[-3]) / 255, 1.0]
  </code></pre>
  
  <p>The problem is that calculating the sha1 of numbers many times is very slow in total. (I'm using this function about 100k times)</p>
  
  <p>Edit: The reason I use a hash function is that I want to have colors that are different for numbers that are close </p>
  
  <p>e.g <code>id_to_random_color(7)</code> should be very different from <code>id_to_random_color(9)</code></p>