onColorFor static method

Color onColorFor(
  1. Color background
)

A foreground color that reads well on background.

Implementation

static Color onColorFor(Color background) {
  return ThemeData.estimateBrightnessForColor(background) == Brightness.dark
      ? Colors.white
      : Colors.black87;
}