brighten method

Color brighten(
  1. double amount
)

Brighten the shade of the color by the amount.

amount is a double between 0 and 1.

Based on: https://stackoverflow.com/a/60191441.

Implementation

Color brighten(double amount) {
  assert(amount >= 0 && amount <= 1);

  final hsl = HSLColor.fromColor(this);
  return hsl
      .withLightness(
        clampDouble(hsl.lightness + (1 - hsl.lightness) * amount, 0.0, 1.0),
      )
      .toColor();
}