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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| /// Définition de couleurs
#if !defined COLOR_TERM_H
# define COLOR_TERM_H
#define _0_ "\x1b[0m" /* Normal */
#define _v_ "\x1b[1m" /* Bright / bold */
#define _p_ "\x1b[2m" /* Faint (Pale) */
#define _u_ "\x1b[4m" /* Italic / underlined */
#define _b_ "\x1b[5m" /* Blinking */
#define _i_ "\x1b[7m" /* Inverted */
#define _h_ "\x1b[8m" /* Invisible / hidden */
#define _s_ "\x1b[9m" /* Streched / Crossed-out */
#define C_ "\x1B[0m" /* Termine un changement de couleur "\x1B[0m" is sufficient */
// TODO Check if "\x1B[0;0m" is correct (Set foreground and background color to default.)...
// NOTE Should'nt be "\x1B[0;32;40m" For screen default color green on black
// Ci-dessous: les initiales d'un changement de couleur
#define _N0 "\x1B[0;30m" /* Couleurs normales */
#define _R0 "\x1B[0;31m"
#define _V0 "\x1B[0;32m"
#define _J0 "\x1B[0;33m"
#define _B0 "\x1B[0;34m"
#define _M0 "\x1B[0;35m"
#define _C0 "\x1B[0;36m"
#define _G0 "\x1B[0;37m"
#define _nv "\x1B[1;30m" /* Couleurs vives */
#define _rv "\x1B[1;31m"
#define _vv "\x1B[1;32m"
#define _jv "\x1B[1;33m"
#define _bv "\x1B[1;34m"
#define _mv "\x1B[1;35m"
#define _cv "\x1B[1;36m"
#define _gv "\x1B[1;37m"
#define _n "\x1B[2;30m" /* Couleurs pâles */
#define _r "\x1B[2;31m"
#define _v "\x1B[2;32m"
#define _j "\x1B[2;33m"
#define _b "\x1B[2;34m"
#define _m "\x1B[2;35m"
#define _c "\x1B[2;36m"
#define _g "\x1B[2;37m"
#define _nu "\x1B[4;30m" /* Soulignées */
#define _ru "\x1B[4;31m"
#define _vu "\x1B[4;32m"
#define _ju "\x1B[4;33m"
#define _bu "\x1B[4;34m"
#define _mu "\x1B[4;35m"
#define _cu "\x1B[4;36m"
#define _gu "\x1B[4;37m"
#define _nb "\x1B[5;30m" /* Blinking */
#define _rb "\x1B[5;31m"
#define _vb "\x1B[5;32m"
#define _jb "\x1B[5;33m"
#define _bb "\x1B[5;34m"
#define _mb "\x1B[5;35m"
#define _cb "\x1B[5;36m"
#define _gb "\x1B[5;37m"
#define _ni "\x1B[7;30m" /* Couleurs inversées */
#define _ri "\x1B[7;31m"
#define _vi "\x1B[7;32m"
#define _ji "\x1B[7;33m"
#define _bi "\x1B[7;34m"
#define _mi "\x1B[7;35m"
#define _ci "\x1B[7;36m"
#define _gi "\x1B[7;37m"
#define _ns "\x1B[9;30m" /* Caractères barrés */
#define _rs "\x1B[9;31m"
#define _vs "\x1B[9;32m"
#define _js "\x1B[9;33m"
#define _bs "\x1B[9;34m"
#define _ms "\x1B[9;35m"
#define _cs "\x1B[9;36m"
#define _gs "\x1B[9;37m"
/** NOTE : _Ro(" rouge "_Bl(" bleu ")" rouge ") DOES NOT WORK !
Do so : _Ro(" rouge ")_Bl(" bleu ")_Ro(" rouge ")
. +------------+---- "normal":0, "vif"(gras):1, "pâle":2,
. | | "souligné":4, "cligno/gras":5, "vidéo inverse":7, "caché":8,
. | +-------------- 30:Noir, 31:Rouge, 32:Vert, 33:Jaune
. | | | 34:Bleu, 35:Magenta, 36:Cyan, 37:Gris */
#if 0 /* OK for Xterm */
#define _No(s) "\x1B[0;30m"s"\x1B[0;0m"
#define _Ro(s) "\x1B[0;31m"s"\x1B[0;0m"
#define _Ve(s) "\x1B[0;32m"s"\x1B[0;0m"
#define _Ja(s) "\x1B[0;33m"s"\x1B[0;0m"
#define _Bl(s) "\x1B[0;34m"s"\x1B[0;0m"
#define _Ma(s) "\x1B[0;35m"s"\x1B[0;0m"
#define _Cy(s) "\x1B[0;36m"s"\x1B[0;0m" /* ~bleu */
#define _Gr(s) "\x1B[0;37m"s"\x1B[0;0m" /* ~rouge */
// The above colors are well for XTerm but hugly in Konsol
#else /* Beter for Konsol */
#define _No(s) _nv""s""C_
#define _Ro(s) _rv""s""C_
#define _Ve(s) _vv""s""C_
#define _Ja(s) _jv""s""C_
#define _Bl(s) _bv""s""C_
#define _Ma(s) _mv""s""C_ /* ~ fuchia */
#define _Cy(s) _cv""s""C_ /* ~ bleu ciel */
// #define _Gr(s) _gv""s""C_
#define _Gr(s) _G0""s""C_
#endif
#endif /* !defined COLOR_TERM_H */ |
Partager