lighten static method

Color lighten(
  1. Color color, [
  2. double amount = .1
])

Implementation

static Color lighten(Color color, [double amount = .1]) {
  if (amount < 0) amount = 0;
  if (amount > 1) amount = 1;

  final hsl = HSLColor.fromColor(color);
  final hslLight =
      hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0));

  return hslLight.toColor();
}