getContrastColor static method
Implementation
static getContrastColor(Color color) {
double sum =
(color.red * 0.299) + (color.green * 0.587) + (color.blue * 0.114);
if (sum > 150) {
return Colors.black;
}
return Colors.white;
}
static getContrastColor(Color color) {
double sum =
(color.red * 0.299) + (color.green * 0.587) + (color.blue * 0.114);
if (sum > 150) {
return Colors.black;
}
return Colors.white;
}