Android examples for android.graphics:Color
create Color Filter By Color
import android.graphics.ColorMatrixColorFilter; public class Main { public static ColorMatrixColorFilter createColorFilterByColor(int aColor) { final int r = (aColor >> 16) & 255; final int g = (aColor >> 8) & 255; final int b = aColor & 255; final float[] array = new float[] { 0, 0, 0, 0, r, 0, 0, 0, 0, g, 0, 0, 0, 0, b, 0, 0, 0, 1, 0 }; return new ColorMatrixColorFilter(array); }/*from ww w .j a v a 2 s . c o m*/ }