onBackground static method
Applies a background color and optional foreground to the given text.
If foreground is provided, it wraps the background-colored text with the foreground style.
Example:
print(AnsiOutput.onBackground(AnsiColor.BG_BLUE, "Note", AnsiColor.WHITE));
Implementation
static String onBackground(AnsiColor background, String text, [AnsiColor? foreground]) {
final base = background(text);
return foreground != null ? foreground(base) : base;
}