title: Retrieving color programmatically from R.color returns wrong colors
body: <p>I am trying to take color names listed in a user's xml file and return the hexadecimal color.  I am using the code based off the post <a href="https://stackoverflow.com/questions/26584922/retrieve-color-programmatically-from-r-color">Retrieve color programmatically from R.color</a>.  I know I am close because when I had a small set of colors in hash map with the names as keys it was working, but over 300 colors in the file and looking for 5 or 6 seems like wasted processing time.  The code below is what is being worked with, but I can include more if needed.  </p>
  
  <p>Example of user's xml file.</p>
  
  <pre><code>&lt;Item&gt;
      &lt;Item_Name&gt;Daily&lt;/Item_Name&gt;
      &lt;Price&gt;400&lt;/Price&gt;
      &lt;Type&gt;Entry&lt;/Type&gt;
      &lt;Color&gt;Green&lt;/Color&gt;
  &lt;/Item&gt;
  </code></pre>
  
  <p>colors.xml</p>
  
  <pre><code> &lt;color name="green"&gt;#008000&lt;/color&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code> 0   **pass in name from method call**
   1   Class res = R.color.class;
   2   Field field = res.getField( name );
   3   color = field.getInt(null);
  </code></pre>
  
  <p>When I run this as debug the results given are as follows:</p>
  
  <pre><code>0: name = "green"
  1: res = tech.travis.poolpos.R$color
  2: field = public static final int tech.travis.poolpos.R$color.green
  3: color = 2131099743 (integer).  This translates to #&amp;5f00067f,
       which is about a navy blue with an opacity of about 37%.
  </code></pre>
  
  <p>The integer that should be returned for green should be -16744448, not 2131099743.</p>
  
  <p>How, if possible, do I take a name as a string and match it and return a color listed in colors.xml?</p>