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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#ifndef __COLOURS_HPP__
#define __COLOURS_HPP__
#if defined(linux) || defined(__linux) || defined(__linux__)
#define C_LIGHTBLACK 30
#define C_LIGHTRED 31
#define C_LIGHTGREEN 32
#define C_LIGHTYELLOW 33
#define C_LIGHTBLUE 34
#define C_LIGHTPURPLE 35
#define C_LIGHTCYAN 36
#define C_LIGHTWHITE 37
#define C_BACKBLACK 40
#define C_BACKRED 41
#define C_BACKGREEN 42
#define C_BACKYELLOW 43
#define C_BACKBLUE 44
#define C_BACKPURPLE 45
#define C_BACKCYAN 46
#define C_BACKWHITE 47
#define C_DEFAULT 0
#define C_BRIGHT 1
#define C_BLINK 5
#endif
#if defined(__WIN32__) || defined(WIN) || defined(WIN32)
#define C_LIGHTBLACK 0
#define C_LIGHTRED 4
#define C_LIGHTGREEN 2
#define C_LIGHTYELLOW 14
#define C_LIGHTBLUE 1
#define C_LIGHTPURPLE 5
#define C_LIGHTCYAN 11
#define C_LIGHTWHITE 15
#define C_BACKBLACK 0
#define C_BACKRED 4
#define C_BACKGREEN 2
#define C_BACKYELLOW 14
#define C_BACKBLUE 1
#define C_BACKPURPLE 5
#define C_BACKCYAN 11
#define C_BACKWHITE 15
#define C_DEFAULT 0
#define C_BRIGHT +8
#define C_BLINK 6
#endif
#ifdef __cplusplus
#if defined(linux) || defined(__linux) || defined(__linux__)
#define COLOURF(cletter) "\033[" << cletter << "m"
#define COLOURFB(cletter,background) "\033[" << cletter << "," << background << "m"
#define CRESET() "\033[0m"
#endif
#if defined(__WIN32__) || defined(WIN) || defined(WIN32)
#define COLOURF(cletter) ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),cletter); std::cout
#define COLOURFB(cletter,background) ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),background*16+cletter); std::cout
#define CRESET() ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15); std::cout
#endif
#else
#if defined(linux) || defined(__linux) || defined(__linux__)
#define COLOURF(cletter) printf("\033[%dm",cletter);
#define COLOURFB(cletter,background) printf("\033[%d,%dm",cletter,background);
#define CRESET() printf("\033[0m");
#endif
#if defined(__WIN32__) || defined(WIN) || defined(WIN32)
#define COLOURF(cletter) ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),cletter); std::cout
#define COLOURFB(cletter,background) ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),background*16+cletter); std::cout
#define CRESET() ""; SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),15); std::cout
#endif
#endif
#endif |
Partager