bool isValidDarkColor(Color? color) { if (color == null) { return false; } return color.computeLuminance() <= _lightDarkLuminanceThreshold; }