public static int calculateDarkerColor(final int color,final float factor){
  final int a=Color.alpha(color);
  final int r=Color.red(color);
  final int g=Color.green(color);
  final int b=Color.blue(color);
  final int lightnessLevel=Math.round(RGB_TOTAL_COLORS * factor);
  return Color.argb(a,Math.max(r - lightnessLevel,0),Math.max(g - lightnessLevel,0),Math.max(b - lightnessLevel,0));
}

public static int calculateDarkerColor ( final int color , final float factor ) { final int a = Color . alpha ( color ) ; final int r = Color . red ( color ) ; final int g = Color . green ( color ) ; final int b = Color . blue ( color ) ; final int lightnessLevel = Math . round ( RGB_TOTAL_COLORS * factor ) ; return Color . argb ( a , Math . max ( r - lightnessLevel , 0 ) , Math . max ( g - lightnessLevel , 0 ) , Math . max ( b - lightnessLevel , 0 ) ) ; }
this method calculates a darker color provided a factor of reduction in lightness .
