brightness static method
Implementation
static double brightness(Color? color) {
color ??= Colors.transparent;
double r = 0.299 * color.red;
double g = 0.587 * color.green;
double b = 0.114 * color.blue;
double luminance = (r + g + b) / 255;
return luminance;
}