coloringMethod static method
Coloring
Implementation
static String coloringMethod(ColorTheme theme, Object object) {
int color = 0;
switch (theme) {
case ColorTheme.red:
color = 31;
break;
case ColorTheme.yellow:
color = 33;
break;
case ColorTheme.green:
color = 32;
break;
case ColorTheme.blue:
color = 34;
break;
case ColorTheme.cyan:
color = 36;
break;
case ColorTheme.white:
color = 37;
break;
case ColorTheme.black:
color = 30;
break;
default:
color = 97;
}
return '\x1B[${color}m$object\x1B[0m';
}