call method
Applies the ANSI color codes to the provided msg
and resets formatting after.
If color is false
, the original message is returned unmodified.
Example:
final red = AnsiColor.fg(9);
print(red('Error!')); // Prints in red
Implementation
String call(String msg) {
if (color) {
return '$this$msg$ansiDefault';
} else {
return msg;
}
}