darken method

Color darken(
  1. double amount
)

Darkens this color by the given amount (0.0 to 1.0)

Implementation

Color darken(double amount) {
  final hsl = HSLColor.fromColor(this);
  final lightness = (hsl.lightness - amount).clamp(0.0, 1.0);
  return hsl.withLightness(lightness).toColor();
}