set_foreground_color method

  1. @override
void set_foreground_color(
  1. AnsiForegroundColor foreground
)
override

Sets the console foreground color to a named ANSI color.

There are 16 named ANSI colors, as defined in the AnsiForegroundColor enumeration. Depending on the console theme and background color, some colors may not offer a legible contrast against the background.

Implementation

@override
void set_foreground_color(
  final AnsiForegroundColor foreground,
) {
  stdout.write(
    ansi_set_text_color(foreground),
  );
}