int color = 0; Drawable background = imageButton.getBackground(); if (background instanceof ColorDrawable) { color = ((ColorDrawable)background).getColor(); }