shouldSkipContrastAdjustment static method

bool shouldSkipContrastAdjustment(
  1. String grapheme
)

Whether grapheme is a space, box-drawing, block element, or Powerline symbol whose exact color should not be contrast-shifted.

Implementation

static bool shouldSkipContrastAdjustment(String grapheme) {
  if (grapheme.isEmpty || grapheme == ' ') return true;
  final rune = grapheme.runes.first;
  if (rune >= 0x2500 && rune <= 0x259F) return true;
  if (rune >= 0xE0B0 && rune <= 0xE0D7) return true;
  return false;
}