highlight static method

Color highlight(
  1. Color color, [
  2. double amount = .1
])

Implementation

static Color highlight(Color color, [double amount = .1]) {
  if (amount < 0) amount = 0;
  if (amount > 1) amount = 1;
  double brightness = color.computeLuminance(); // expensive
  return brightness < 0.5 ? lighten(color, amount) : darken(color, amount);
}