isDark property

bool get isDark

Whether the terminal background is dark (luminance < 0.5).

Implementation

bool get isDark {
  final rgb = _parseHexRgb(hex);
  if (rgb == null) return true;
  final (:r, :g, :b) = rgb;
  return isDarkColorRgb(red: r, green: g, blue: b);
}