getColorPen method
AnsiPen
getColorPen()
- Info: Get ANSI XTERM-256 color from log type.
- Params:
this
- Returns: AnsiPen.
- Notes: https://www.ditig.com/256-colors-cheat-sheet
Implementation
AnsiPen getColorPen() {
var color = 253; // Grey 85
switch (name) {
case "verbose":
color = 39; // DeepSkyBlue 1
break;
case "debug":
color = 127; // Magenta 3
break;
case "info":
color = 34; // Green 3
break;
case "warning":
color = 172; // Orange 3
break;
case "error":
color = 124; // Red 3
break;
case "unknown":
color = 253; // Grey 85
break;
}
return AnsiPen() // Return ansi term color.
..reset()
..xterm(color);
}