fillAttributes method

void fillAttributes({
  1. String? char,
  2. int? fg,
  3. int? bg,
  4. int? modifiers,
  5. int? underlineColor,
  6. String? uri,
  7. bool? blend,
})

Fills the entire buffer with the specified attributes.

Implementation

void fillAttributes({
  String? char,
  int? fg,
  int? bg,
  int? modifiers,
  int? underlineColor,
  String? uri,
  bool? blend,
}) {
  if (char != null) characters.fillRange(0, characters.length, char);
  if (fg == null &&
      bg == null &&
      modifiers == null &&
      underlineColor == null &&
      uri == null) {
    return;
  }
  final useBlend = blend ?? defaultBlend;
  for (var i = 0; i < characters.length; i++) {
    _writeCellAttributes(
      i * 3,
      fg: fg,
      bg: bg,
      modifiers: modifiers,
      underlineColor: underlineColor,
      uri: uri,
      blend: useBlend,
    );
  }
}