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