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);

  return Color.fromARGB(
    alpha,
    red + ((255 - red) * amount).round(),
    green + ((255 - green) * amount).round(),
    blue + ((255 - blue) * amount).round(),
  );
}