[PorterDuff.Mode](<http://developer.android.com/reference/android/graphics/PorterDuff.Mode.html>) is used to create a [PorterDuffColorFilter](<http://developer.android.com/reference/android/graphics/PorterDuffColorFilter.html>). A color filter modifies the color of each pixel of a visual resource.

ColorFilter filter = new PorterDuffColorFilter(Color.BLUE, PorterDuff.Mode.SRC_IN);

The above filter will tint the non-transparent pixels to blue color.

The color filter can be applied to a [Drawable](<http://developer.android.com/reference/android/graphics/drawable/Drawable.html#setColorFilter(android.graphics.ColorFilter)>):

drawable.setColorFilter(filter);

It can be applied to an [ImageView](<http://developer.android.com/reference/android/widget/ImageView.html#setColorFilter(int)>):

imageView.setColorFilter(filter);

Also, it can be applied to a [Paint](<http://developer.android.com/reference/android/graphics/Paint.html#setColorFilter(android.graphics.ColorFilter)>), so that the color that is drawn using that paint, is modified by the filter:

paint.setColorFilter(filter);