getDarkerColor static method

Color getDarkerColor(
  1. Color c, [
  2. int percent = 10
])

Implementation

static Color getDarkerColor(Color c, [int percent = 10]) {
  assert(1 <= percent && percent <= 100);
  var f = 1 - percent / 100;
  Color color = Color.fromARGB(c.alpha, (c.red * f).round(),
      (c.green * f).round(), (c.blue * f).round());
  return color;
}