Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.view.View; public class Main { static int getColorViewColor(View colorView) { int color = Color.TRANSPARENT; Drawable background = colorView.getBackground(); if (background instanceof ColorDrawable) color = ((ColorDrawable) background).getColor(); return color; } }