File: color.h

package info (click to toggle)
ceccomp 3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,528 kB
  • sloc: ansic: 3,154; python: 653; makefile: 240; sh: 226
file content (38 lines) | stat: -rw-r--r-- 1,209 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef COLOR
#define COLOR

#include "parseargs.h"
#include <stdbool.h>

#define FORMAT "%04d"

extern bool color_enable;
extern bool log_color_enable;

extern void set_color (ceccomp_args *args, FILE *output);

#define CLR "\x1b[0m"

#define REDCLR "\x1b[31m"
#define GREENCLR "\x1b[32m"
#define YELLOWCLR "\x1b[33m"
#define BLUECLR "\x1b[34m"
#define CYANCLR "\x1b[36m"
#define PURPLECLR "\x1b[95m"
#define LIGHTCLR "\x1b[90m"
#define BRIGHT_YELLOWCLR "\x1b[93m"
#define BRIGHT_BLUECLR "\x1b[94m"
#define BRIGHT_CYANCLR "\x1b[96m"

#define RED(str) ((color_enable) ? (REDCLR str CLR) : str)
#define GREEN(str) ((color_enable) ? (GREENCLR str CLR) : str)
#define YELLOW(str) ((color_enable) ? (YELLOWCLR str CLR) : str)
#define BRIGHT_YELLOW(str) ((color_enable) ? (BRIGHT_YELLOWCLR str CLR) : str)
#define BLUE(str) ((color_enable) ? (BLUECLR str CLR) : str)
#define BRIGHT_BLUE(str) ((color_enable) ? (BRIGHT_BLUECLR str CLR) : str)
#define CYAN(str) ((color_enable) ? (CYANCLR str CLR) : str)
#define BRIGHT_CYAN(str) ((color_enable) ? (BRIGHT_CYANCLR str CLR) : str)
#define PURPLE(str) ((color_enable) ? (PURPLECLR str CLR) : str)
#define LIGHT(str) ((color_enable) ? (LIGHTCLR str CLR) : str)

#endif