isDark function

bool isDark(
  1. Color color, {
  2. double threshold = 0.15,
})

Implementation

bool isDark(Color color, {double threshold = 0.15}) {
  final double relativeLuminance = color.computeLuminance();
  return ((relativeLuminance + 0.05) * (relativeLuminance + 0.05) <= threshold);
}