onSurface static method

Color? onSurface(
  1. Color? surface, [
  2. Color? onLight = black,
  3. Color? onDark = white
])

Estimate foreground color on surface

Implementation

static Color? onSurface(
  Color? surface, [
  Color? onLight = black,
  Color? onDark = white,
]) {
  if (surface == null) return null;
  final brightness = brightnessFor(surface);
  return brightness == Brightness.light ? onLight : onDark;
}