darken method

Color darken(
  1. double amount
)

Darkens this color by amount (0..1) in HSL space.

Implementation

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