You can use the following method to get a darker primary color:
java
/**
* Darkens a color by a given factor.
*
* @param color
* the color to darken
* @param factor
* The factor to darken the color.
* @return darker version of specified color.
*/
@ColorInt public static int darker(@ColorInt int color, @FloatRange(from = 0.0, to = 1.0) float factor) {
return Color.argb(Color.alpha(color),
Math.max((int) (Color.red(color) * factor), 0),
Math.max((int) (Color.green(color) * factor), 0),
Math.max((int) (Color.blue(color) * factor), 0)
);
}
Example:
java
int primaryDark = darker(primaryColor, 0.85f);