public static Bitmap processTintTransformationMap ( Bitmap transformationMap , int tintColor ) { // tint color int [ ] t = new int [ ] { Color . red ( tintColor ) , Color . green ( tintColor ) , Color . blue ( tintColor ) } ; int width = transformationMap . getWidth ( ) ; int height = transformationMap . getHeight ( ) ; int [ ] pixels = new int [ width * height ] ; transformationMap . getPixels ( pixels , 0 , width , 0 , 0 , width , height ) ; float [ ] transformation = new float [ 2 ] ; for ( int i = 0 ; i < pixels . length ; i ++ ) { int color = pixels [ i ] ; int alpha = Color . alpha ( color ) ; transformation [ 0 ] = Color . red ( color ) / 255f ; transformation [ 1 ] = Color . green ( color ) / 255f ; pixels [ i ] = applyTransformation ( t , alpha , transformation ) ; } return Bitmap . createBitmap ( pixels , width , height , Bitmap . Config . ARGB_8888 ) ; }
Apply the given tint color to the transformation map .