Last active
December 1, 2018 03:52
-
-
Save johnelliott/c8fb215a7831356a14cc to your computer and use it in GitHub Desktop.
terminal colors test
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 | |
| # tput_colors - Demonstrate color combinations. http://linuxcommand.org/lc3_adv_tput.php | |
| for fg_color in {0..7}; do | |
| set_foreground=$(tput setaf $fg_color) | |
| for bg_color in {0..7}; do | |
| set_background=$(tput setab $bg_color) | |
| echo -n $set_background$set_foreground | |
| printf ' F:%02s B:%02s ' $fg_color $bg_color | |
| done | |
| echo $(tput sgr0) | |
| done | |
| echo | |
| for fg_color in {8..15}; do | |
| set_foreground=$(tput setaf $fg_color) | |
| for bg_color in {8..15}; do | |
| set_background=$(tput setab $bg_color) | |
| echo -n $set_background$set_foreground | |
| printf ' F:%02s B:%02s ' $fg_color $bg_color | |
| done | |
| echo $(tput sgr0) | |
| done | |
| echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment