title: Android: What is the key for getting the contact background color?
body: <p>So I've been reading up on how the auto-generated background color for contacts is created. Apparently it's based on a hashCode() of a key in the contact. I've seen it said that the email is used as the key, but that makes no sense, since not all my contacts have emails associated with them, and the ones that don't aren't all the same color.</p>
  
  <p>Ultimately, I want to be able to get the EXACT color used in the contact's card. That way the icon I have in my app has the same background color as will be used when you click on it and open the contact card using the ACTION_VIEW.</p>
  
  <p>So, just wondering what I need to use as a key to generate the same color that is generated by the android contacts app, for each individual contact? Thanks.</p>
  
  <p>PS. Here's the hex codes that I have right now for the color palate. If someone could chime in on the accuracy of this as well, I would really appreciate it. Thanks.</p>
  
  <pre><code>&lt;array name="letter_tile_colors"&gt;
          &lt;item&gt;#f16364&lt;/item&gt;
          &lt;item&gt;#f58559&lt;/item&gt;
          &lt;item&gt;#f9a43e&lt;/item&gt;
          &lt;item&gt;#e4c62e&lt;/item&gt;
          &lt;item&gt;#67bf74&lt;/item&gt;
          &lt;item&gt;#59a2be&lt;/item&gt;
          &lt;item&gt;#2093cd&lt;/item&gt;
          &lt;item&gt;#ad62a7&lt;/item&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p>Edit: Some folks have been saying it's similar to another answer, <a href="https://stackoverflow.com/questions/34751185/android-lollipop-contact-color">Android lollipop contact color</a></p>
  
  <p>The problem with that answer is it's incomplete. It explains how to generate colors in the same way, but I'm not just trying to do random color generation. I'm looking to get the EXACT color that the default contacts app uses for that contact.</p>