title: How to get colors from colors.xml in Android
body: <p>I have declared colours in <code>color.xml</code> file but unfortunately unable to get those colours while setting the colour attribute to textview.</p>
  
  <p>Color.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
     &lt;color name="dark_snuff"&gt;#2d3037&lt;/color&gt;  
     &lt;color name="silver"&gt;#C0C0C0&lt;/color&gt;
     &lt;color name="dark_gray"&gt;#A9A9A9&lt;/color&gt; 
  &lt;/resources&gt;
  </code></pre>
  
  <p>layout.xml</p>
  
  <pre><code>&lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical" &gt;
  
              &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="40dip"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
              android:id="@+id/textView19"
              android:layout_width="match_parent"
              android:layout_height="40dip"
              android:text="Date"
              android:textAppearance="?android:attr/textAppearanceLarge" 
              android:background="@android:Color/dark_snuff"/&gt;//error part
  
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <p><code>error: Error: No resource found that matches the given name (at 'background' with value '@android:Color/
   dark_snuff').</code></p>