getBrightness property

double get getBrightness

Returns the brightness of the color.

Example:

Color color = Colors.blue;
double brightness = color.getBrightness;
print('Brightness: $brightness'); // Output: 110.622

Implementation

double get getBrightness => (red * 299 + green * 587 + blue * 114) / 1000;