Skip to content

Instantly share code, notes, and snippets.

@FabulousCupcake
Created January 2, 2022 13:19
Show Gist options
  • Save FabulousCupcake/1df2d3a1f2c359285e14ffee22c0f235 to your computer and use it in GitHub Desktop.
Save FabulousCupcake/1df2d3a1f2c359285e14ffee22c0f235 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Special
readonly DIM="$(tput dim)"
readonly REVERSE="$(tput rev)"
readonly RESET="$(tput sgr0)"
readonly BOLD="$(tput bold)"
echo "Colors: $(tput colors) Text Number: [FG-BG]"
echo
echo " BLACK RED GREEN YELLOW BLUE PURPLE CYAN WHITE "
COLOR_ORDER_FULL=(0 8 1 9 2 10 3 11 4 12 5 13 6 14 7 15)
COLOR_ORDER_NORMAL=(0 1 2 3 4 5 6 7)
COLOR_ORDER_BRIGHT=(8 9 10 11 12 13 14 15)
for row in "${COLOR_ORDER_FULL[@]}"; do
FG="$(tput setaf "$row")"
for col in "${COLOR_ORDER_NORMAL[@]}"; do
BG="$(tput setab "$col")"
TEXT="$(printf "%02d-%02d" $row $col)"
printf "$BG$FG $TEXT $RESET "
done
echo
done
echo
for row in "${COLOR_ORDER_FULL[@]}"; do
FG="$(tput setaf "$row")"
for col in "${COLOR_ORDER_BRIGHT[@]}"; do
BG="$(tput setab "$col")"
TEXT="$(printf "%02d-%02d" $row $col)"
printf "$BG$FG $TEXT $RESET "
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment