Created
October 13, 2016 19:46
-
-
Save nkh/fc9e6e13a49f8dbb7df43124991f2275 to your computer and use it in GitHub Desktop.
This file contains 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
export bold='\e[01m' | |
export underlined='\e[04m' | |
export flashing='\e[05m' | |
export black='\e[30m' | |
export red='\e[31m' | |
export green='\e[32m' | |
export yellow='\e[33m' | |
export blue='\e[34m' | |
export magenta='\e[35m' | |
export cyan='\e[36m' | |
export light_grey='\e[37m' | |
export dark_grey='\e[90m' | |
export light_red='\e[91m' | |
export light_green='\e[92m' | |
export light_yellow='\e[93m' | |
export light_blue='\e[94m' | |
export light_magenta='\e[35m' | |
export liht_cyan='\e[96m' | |
export white='\e[97m' | |
export reset='\e[00m' | |
export on_black='\e[40m' | |
export on_red='\e[41m' | |
export on_green='\e[42m' | |
export on_yellow='\e[43m' | |
export on_blue='\e[44m' | |
export on_magenta='\e[45m' | |
export on_cyan='\e[46m' | |
export on_light_grey='\e[47m' | |
export on_dark_grey='\e[100m' | |
export on_light_red='\e[101m' | |
export on_light_green='\e[102m' | |
export on_light_yellow='\e[103m' | |
export on_light_blue='\e[104m' | |
export on_light_magenta='\e[105m' | |
export on_liht_cyan='\e[106m' | |
export on_white='\e[107m' | |
function ansi_colors() | |
{ | |
for clbg in 040 100 ; do | |
#Foreground | |
for clfg in {30..37} {90..97} 39 ; do | |
#Formatting | |
for attr in 0 1 2 4 5 7 ; do | |
#Print the result | |
echo -en "\e[${attr};${clbg};${clfg}m ^[${attr};${clbg};${clfg}m \e[0m" | |
done | |
echo #Newline | |
done | |
done | |
} | |
function ansi_colors_all() | |
{ | |
for clbg in {40..47} {100..107} 49 ; do | |
#Foreground | |
for clfg in {30..37} {90..97} 39 ; do | |
#Formatting | |
for attr in 0 1 2 4 5 7 ; do | |
#Print the result | |
echo -en "\e[${attr};${clbg};${clfg}m ^[${attr};${clbg};${clfg}m \e[0m" | |
done | |
echo #Newline | |
done | |
done | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment