Last active
July 7, 2022 07:58
-
-
Save Stfort52/1cce9bc74d6eca45b569577a98341702 to your computer and use it in GitHub Desktop.
Colors == Justice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __LIB_COLORS_H | |
#define __LIB_COLORS_H | |
#ifndef NO_COLORS | |
/** | |
* ANSI Escapes for Normal Colors. | |
*/ | |
#define BLK(TEXT) "\x1b[30m"TEXT"\x1b[0m" | |
#define RED(TEXT) "\x1b[31m"TEXT"\x1b[0m" | |
#define GRN(TEXT) "\x1b[32m"TEXT"\x1b[0m" | |
#define YEL(TEXT) "\x1b[33m"TEXT"\x1b[0m" | |
#define BLU(TEXT) "\x1b[34m"TEXT"\x1b[0m" | |
#define MAG(TEXT) "\x1b[35m"TEXT"\x1b[0m" | |
#define CYN(TEXT) "\x1b[36m"TEXT"\x1b[0m" | |
#define WHT(TEXT) "\x1b[37m"TEXT"\x1b[0m" | |
/** | |
* ANSI Escapes for Bright Colors. | |
*/ | |
#define SBLK(TEXT) "\x1b[90m"TEXT"\x1b[0m" | |
#define SRED(TEXT) "\x1b[91m"TEXT"\x1b[0m" | |
#define SGRN(TEXT) "\x1b[92m"TEXT"\x1b[0m" | |
#define SYEL(TEXT) "\x1b[93m"TEXT"\x1b[0m" | |
#define SBLU(TEXT) "\x1b[94m"TEXT"\x1b[0m" | |
#define SMAG(TEXT) "\x1b[95m"TEXT"\x1b[0m" | |
#define SCYN(TEXT) "\x1b[96m"TEXT"\x1b[0m" | |
#define SWHT(TEXT) "\x1b[97m"TEXT"\x1b[0m" | |
#else | |
/** | |
* Fallbacks. | |
*/ | |
#define BLK(TEXT) TEXT | |
#define RED(TEXT) TEXT | |
#define GRN(TEXT) TEXT | |
#define YEL(TEXT) TEXT | |
#define BLU(TEXT) TEXT | |
#define MAG(TEXT) TEXT | |
#define CYN(TEXT) TEXT | |
#define WHT(TEXT) TEXT | |
/** | |
* Fallbacks. | |
*/ | |
#define SBLK(TEXT) TEXT | |
#define SRED(TEXT) TEXT | |
#define SGRN(TEXT) TEXT | |
#define SYEL(TEXT) TEXT | |
#define SBLU(TEXT) TEXT | |
#define SMAG(TEXT) TEXT | |
#define SCYN(TEXT) TEXT | |
#define SWHT(TEXT) TEXT | |
#endif | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RED () { | |
echo -e "\x1b[31m$*\x1b[0m" | |
} | |
GRN () { | |
echo -e "\x1b[32m$*\x1b[0m" | |
} | |
YEL () { | |
echo -e "\x1b[33m$*\x1b[0m" | |
} | |
BLU () { | |
echo -e "\x1b[34m$*\x1b[0m" | |
} | |
MAG () { | |
echo -e "\x1b[35m$*\x1b[0m" | |
} | |
CYN () { | |
echo -e "\x1b[36m$*\x1b[0m" | |
} | |
WHT () { | |
echo -e "\x1b[37m$*\x1b[0m" | |
} | |
BLK () { | |
echo -e "\x1b[30m$*\x1b[0m" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment