desaturate method

Color desaturate(
  1. double amount
)

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

Implementation

Color desaturate(double amount) {
  final hsl = HSLColor.fromColor(this);
  final saturation = (hsl.saturation - amount).clamp(0.0, 1.0);
  return hsl.withSaturation(saturation).toColor();
}