I can I get a background Color of button? [Android Studio]
<p>I made a method like this:</p>

<pre><code>public void points(Button btn)
{

    Drawable buttonBackground = btn.getBackground(); //doesn't work
    if(buttonBackground.equals(Color.RED))
        counter++;
    else if(buttonBackground.equals(Color.BLACK))
        counter-=10;
    else if(buttonBackground.equals(Color.rgb(212,175,55)))
        counter+=10;
}
</code></pre>

<p>I want to know the background color of the button and the android doesn't have(I think) <code>button.getBackground.getColor()</code> or something like that. Is it possible?</p>

<p>Thanks!</p>