getLighterColor static method

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

Implementation

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