I have a plain ImageView object colorSquare.
ImageView
colorSquare
It is straightforward to set the color of the object by calling.
colorSquare.s
What u can do is
get ColorDrawable from ImageView.
ColorDrawable drawable = (ColorDrawable) colorSquare.getBackground();
now
drawable.getColor()
will give u the Color.
This will work only if u have set the Color or else u will get ClassCastException