Created
May 5, 2022 18:09
-
-
Save sydrawat01/04286b7e04aeb8b7e73947ad98327edb to your computer and use it in GitHub Desktop.
Run the script to see the color scheme of your terminal as a horizontal list of colors.
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 | |
| # Show available terminal colours. | |
| # Heavily modified version of the TLDP script here: | |
| # http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
| print_colors(){ | |
| echo | |
| # Print rows. | |
| for bold in ${bolds[@]}; do | |
| for fg in ${fgs[@]}; do | |
| # Print cells. | |
| for bg in ${bgs[@]}; do | |
| # Print cell. | |
| printf "\e[%s;%s;%sm%s \e[0m\e " $bold $fg $bg " " | |
| done | |
| echo | |
| done | |
| done | |
| } | |
| # Print standard colors. | |
| bolds=( 0 1 ) | |
| fgs=( 3{5..7} ) | |
| bgs=( 4{0..8} ) | |
| print_colors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment