lighten function

Color lighten(
  1. Color color, {
  2. double amount = 0.5,
})

Implementation

Color lighten(Color color, {double amount = 0.5}) {
  assert(amount >= 0 && amount <= 1, 'Amount must be between 0 and 1');

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

  return hslLight.toColor();
}