if (!colorEnabled)
{
return output;
}
Ansi ansi = new Ansi();
switch (color)
{
case BLACK:
ansi.fg(Ansi.Color.BLACK);
break;
case BLUE:
ansi.fg(Ansi.Color.BLUE);
break;
case CYAN:
ansi.fg(Ansi.Color.CYAN);
break;
case GREEN:
ansi.fg(Ansi.Color.GREEN);
break;
case MAGENTA:
ansi.fg(Ansi.Color.MAGENTA);
break;
case RED:
ansi.fg(Ansi.Color.RED);
break;
case WHITE:
ansi.fg(Ansi.Color.WHITE);
break;
case YELLOW:
ansi.fg(Ansi.Color.YELLOW);
break;
case BOLD:
ansi.a(Ansi.Attribute.INTENSITY_BOLD);
break;
case ITALIC:
ansi.a(Ansi.Attribute.ITALIC);
ansi.a(Ansi.Attribute.INTENSITY_FAINT);
break;
default:
return output;
}
return ansi.render(output).reset().toString();
}