Here you can find the source of createColorChangeFilter( int newColor)
public static ColorMatrixColorFilter createColorChangeFilter( int newColor)
//package com.java2s; import android.graphics.ColorMatrixColorFilter; public class Main { public static ColorMatrixColorFilter createColorChangeFilter( int newColor) { final int r = (newColor >> 16) & 255; final int g = (newColor >> 8) & 255; final int b = newColor & 255; float rRatio = ((float) r) / 255.0f; float gRatio = ((float) g) / 255.0f; float bRatio = ((float) b) / 255.0f; final float[] array = new float[] { rRatio, 0, 0, 0, 0, 0, gRatio, 0, 0, 0, 0, 0, bRatio, 0, 0, 0, 0, 0, 1, 0 }; return new ColorMatrixColorFilter(array); }/*from w w w. j a v a 2s. c o m*/ }