If you have an imageView like this:
<ImageView
android:id="@+id/color_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:src="@drawable/circle_color"/>
which give it a drawable shape as src, you can use this code to change shape's color:
ImageView iv = (ImageView)findViewById(R.id.color_button);
GradientDrawable bgShape = (GradientDrawable)iv.getDrawable();
bgShape.setColor(Color.BLACK);