 <p>Here is an additional option:</p> <p>The way I solved this problem for my app was to define the colors in values/color.xml. </p> <pre><code>&lt;resources&gt; &lt;color name="blue"&gt;#ff0099cc&lt;/color&gt; &lt;color name="dark_grey"&gt;#ff1d1d1d&lt;/color&gt; &lt;color name="white"&gt;#ffffffff&lt;/color&gt; ... &lt;color name="textview_background"&gt;@color/white&lt;/color&gt; &lt;/resources&gt; </code></pre> <p>In the layout the <code>TextView</code> has:</p> <pre><code>android:background="@color/textview_background" </code></pre> <p>If I want to get the background color in code I can just use:</p> <pre><code>getResources().getColor(R.color.textview_background) </code></pre> <p>This gives me a <code>Color</code> object directly without worrying about getting the color from a <code>Drawable</code>.</p>