public static int blendColors(int color1,int color2,float ratio){
  float proportion=ratio;
  proportion=Math.min(1.0f,proportion);
  proportion=Math.max(0.0f,proportion);
  int[] color1Comps={Color.alpha(color1),Color.red(color1),Color.green(color1),Color.blue(color1)};
  int[] color2Comps={Color.alpha(color2),Color.red(color2),Color.green(color2),Color.blue(color2)};
  int[] newColorComps={0,0,0,0};
  for (int i=0; i < 4; i++) {
    newColorComps[i]=Math.round(color1Comps[i] + ((color2Comps[i] - color1Comps[i]) * proportion));
  }
  return Color.argb(newColorComps[0],newColorComps[1],newColorComps[2],newColorComps[3]);
}

public static int blendColors ( int color1 , int color2 , float ratio ) { float proportion = ratio ; proportion = Math . min ( 1.0f , proportion ) ; proportion = Math . max ( 0.0f , proportion ) ; int [ ] color1Comps = { Color . alpha ( color1 ) , Color . red ( color1 ) , Color . green ( color1 ) , Color . blue ( color1 ) } ; int [ ] color2Comps = { Color . alpha ( color2 ) , Color . red ( color2 ) , Color . green ( color2 ) , Color . blue ( color2 ) } ; int [ ] newColorComps = { 0 , 0 , 0 , 0 } ; for ( int i = 0 ; i < 4 ; i ++ ) { newColorComps [ i ] = Math . round ( color1Comps [ i ] + ( ( color2Comps [ i ] - color1Comps [ i ] ) * proportion ) ) ; } return Color . argb ( newColorComps [ 0 ] , newColorComps [ 1 ] , newColorComps [ 2 ] , newColorComps [ 3 ] ) ; }
blends the two provided colors according to the ratio
