useBlack function
useBlack is a helper function to detect if the color should have the content
with Colors.White
or Colors.black color.
Will return a bool indicating if the color should be Colors.White
or Colors.black.
Implementation
bool useBlack({required Color color, double tolerance = 0.5}) {
final luminance = color.computeLuminance();
return luminance > tolerance;
}