Help you choosing the black or white foreground color to improve the foreground visible.
bool useWhiteForeground(Color backgroundColor) => 1.05 / (backgroundColor.computeLuminance() + 0.05) > 4.5;