List of utility methods to do Color Blend
ColorMatrixColorFilter | createColorFilterByColor( int color, float alpha) create Color Filter By Color final int r = (color >> 16) & 255; final int g = (color >> 8) & 255; final int b = color & 255; final float[] array = new float[] { 0, 0, 0, 0, r, 0, 0, 0, 0, g, 0, 0, 0, 0, b, 0, 0, 0, alpha, 0 }; return new ColorMatrixColorFilter(array); |
ColorMatrixColorFilter | createDarkerColorFilter( float darkRatio) create Darker Color Filter final float[] array = new float[] { darkRatio, 0, 0, 0, 0, 0, darkRatio, 0, 0, 0, 0, 0, darkRatio, 0, 0, 0, 0, 0, 1, 0 }; return new ColorMatrixColorFilter(array); |
ColorMatrixColorFilter | createNightColorFilter() create Night Color Filter return createDarkerColorFilter(DEFUALT_NIGHT_DARK_RATIO);
|
int | getAlpha(int color) get Alpha return ((0xff000000 & color) >> 24);
|