Created
April 9, 2020 04:06
-
-
Save janlay/de6efb288042f521eb038243b9827bb9 to your computer and use it in GitHub Desktop.
Full preview for tput foreground and background
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
#!/bin/bash | |
# author: [email protected] | |
set -e | |
cols=$(bc <<< "$(tput cols) / 3 - 2") | |
char=✾ | |
echo -n ' ' | |
for col in $(seq 0 $cols); do | |
printf '%3s' $col | |
done | |
echo | |
for f in {0..255}; do | |
printf '%3s' $f | |
f_color=$(tput setaf $f) | |
for b in $(seq 0 $cols); do | |
echo -n "$f_color$(tput setab $b) $char " | |
done | |
echo $(tput sgr0) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment