textToAnsi function
Implementation
String textToAnsi(text,
{LogStyle style = const LogStyle(), bool enableAnsi = true}) {
if (!enableAnsi) {
return text;
}
final fg = style.textColor == null ? '' : ';${style.textColor}';
final bg = style.backgroundColor == null ? '' : ';${style.backgroundColor}';
return '\x1B[${style.attr.index}$fg${bg}m$text\x1B[0m';
}