isDark method

bool isDark()

Determines whether the given color is "dark".

A color is considered dark if its brightness is less than 128. The brightness is calculated based on the RGB values of the color.

Example:

Color darkColor = Color(0xFF1A1A1A);
print(darkColor.isDark()); // Output: true

Color lightColor = Color(0xFFFFF1F1);
print(lightColor.isDark()); // Output: false

Implementation

bool isDark() => getBrightness() < 128.0;