colorOnSurface static method

Color? colorOnSurface(
  1. Color? surface, [
  2. Color? onLight = colorBlack,
  3. Color? onDark = colorWhite
])

Estimate foreground color on surface

Implementation

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