onSurface static method
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;
}