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