lighten method

Color lighten([
  1. double amount = .1
])

Lighten the color by percentage (0.0 to 1.0).

Implementation

Color lighten([double amount = .1]) {
  assert(amount >= 0 && amount <= 1, 'Percentage must be between 0 and 1');

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

  return hslLight.toColor();
}