getShadedColor function

Color getShadedColor(
  1. Color input,
  2. double shade
)

Converts an input color into its shade with lightness input Color to be converted shade Shade from 0-1

Implementation

Color getShadedColor(Color input, double shade) {
  return Color.fromARGB(
    input.alpha,
    changeShade(input.red, 1 - shade),
    changeShade(input.green, 1 - shade),
    changeShade(input.blue, 1 - shade),
  );
}