parent
7c2d0d5625
commit
492725ed63
@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define COLOR(name, value) \
|
||||
char *color_##name() { \
|
||||
static char *out = NULL; \
|
||||
if (out == NULL) { \
|
||||
out = isatty(fileno(stderr)) ? "\x1b[" value "m" : ""; \
|
||||
} \
|
||||
return out; \
|
||||
}
|
||||
|
||||
COLOR(reset, "0")
|
||||
COLOR(yellow, "93")
|
||||
COLOR(faint, "2")
|
||||
COLOR(red, "91")
|
Loading…
Reference in new issue