validateColor 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 Color indicating if the color.
Implementation
Color validateColor({required Color color}) {
if (useBlack(color: color)) {
return Colors.black;
}
return Colors.white;
}