bool isValidLightColor(Color? color) { if (color == null) { return false; } return color.computeLuminance() >= 1 - _lightDarkLuminanceThreshold; }