darken static method

Color darken(
  1. Color color,
  2. double percent
)

Converts the given color as dark as the given percent and return it.

Implementation

static Color darken(Color color, double percent) {
    return Color.fromARGB(
        color.alpha,
        (color.red * (1 - percent)).round(),
        (color.green * (1 - percent)).round(),
        (color.blue * (1 - percent)).round()
    );
}