background property

int background

Escape sequence value representing this color as background color.

import 'dart:io';

void main() {
  example(Ansi1BitColors.red, 'Hello World');
}

void example(Ansi1BitColors color, String message) {
  stdout.write('\u001b[${color.background}m');
  stdout.write(message);
}

Implementation

int get background => index + _offsetToBackgroundColors;