-
Notifications
You must be signed in to change notification settings - Fork 0
/
couleurs.h
48 lines (39 loc) · 1.58 KB
/
couleurs.h
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
/*******************************************************************************
Change la couleur du text en ligne de commande.
Deux version : Windows et Linux/Unix
*******************************************************************************/
#ifdef WIN32
#include <windows.h>
#define textcolor(color) \
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color)
#define BLACK textcolor( 0 );
#define RED textcolor( 12 );
#define GREEN textcolor( 2 );
#define YELLOW textcolor( 14 );
#define BLUE textcolor( 9 );
#define PURPLE textcolor( 13 );
#define CYAN textcolor( 11 );
#define GREY textcolor( 8 );
#define DEFAULT_COLOR textcolor( 7 );
#else
#ifndef BG_LIGHT
#define BLACK printf("\033[1;30m");
#define RED printf("\033[1;31m");
#define GREEN printf("\033[1;32m");
#define YELLOW printf("\033[1;33m");
#define BLUE printf("\033[1;34m");
#define PURPLE printf("\033[1;35m");
#define CYAN printf("\033[1;36m");
#define GREY printf("\033[1;37m");
#else // else BG_LIGHT
#define BLACK printf("\033[0;30m");
#define RED printf("\033[0;31m");
#define GREEN printf("\033[0;32m");
#define YELLOW printf("\033[0;33m");
#define BLUE printf("\033[0;34m");
#define PURPLE printf("\033[0;35m");
#define CYAN printf("\033[0;36m");
#define GREY printf("\033[0;37m");
#endif // endif BG_LIGHT
#define DEFAULT_COLOR printf("\033[0;m");
#endif