title: How to convert arbitrary string to hexadecimal color code
body: <p>I've a list of arbitrary strings. I would like to convert these to a hexadecimal color code. </p>
  
  <p>The code should not be random, as it is essential that the method must return the same color code each time I convert the same string.</p>
  
  <p><strong>SOLUTION:</strong></p>
  
  <pre><code>public string GetColorCode(string value)
  {
      var i = value.GetHashCode() &amp; 0x00FFFFFF;
      return i.ToString("X6");
  }
  </code></pre>