Created
July 7, 2017 19:44
-
-
Save p1xelHer0/b9dc3fe83d966a7c109bbfbcfed557a9 to your computer and use it in GitHub Desktop.
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
# https://superuser.com/questions/270214/how-can-i-change-the-colors-of-my-xterm-using-ansi-escape-sequences | |
colortest() { | |
text='•‿•' | |
printf "base "; | |
for base in 00 01 02 03 04 05 06 07 08 09 '0A' '0B' '0C' '0D' '0E' '0F'; do | |
printf " ${base} "; | |
done | |
printf "\n"; | |
for FG in 00 18 19 08 20 07 21 15 01 16 03 02 06 04 05 17; do | |
printf "\e[38;5;${FG}mcolor${FG}\e[0m "; | |
for BG in 00 18 19 08 20 07 21 15 01 16 03 02 06 04 05 17; do | |
printf " \e[38;5;${FG}m\e[48;5;${BG}m ${text} \e[0m "; | |
done | |
printf "\n" | |
printf "\e[1;38;5;${FG}mcolor${FG}\e[0m "; | |
for BG in 00 18 19 08 20 07 21 15 01 16 03 02 06 04 05 17; do | |
printf " \e[1;38;5;${FG}m\e[48;5;${BG}m ${text} \e[0m "; | |
done | |
printf "\n" | |
done | |
} | |
colortest_small() { | |
declare -a colors=( 00 07 01 16 03 02 06 04 05 17 ) | |
for (( i = 1; i <= ${#colors[*]}; ++ i )); do | |
printf "\e[38;5;${colors[i]}m\e[48;5;${colors[i+1]}m█▓░\e[0m"; | |
done | |
printf "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment