Last active
September 2, 2021 06:18
-
-
Save lisanhu/f99c8d1f44959f6989eabbc9c860c7e2 to your computer and use it in GitHub Desktop.
view terminfo colors and their corresponding color code
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 | |
# origin: https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes | |
color(){ | |
for c; do | |
printf '\e[48;5;%dm%03d ' $c $c # adding one more space in the end to seperate the numbers | |
done | |
printf '\e[0m \n' | |
} | |
IFS=$' \t\n' | |
color {0..15} | |
for ((i=0;i<6;i++)); do | |
color $(seq $((i*36+16)) $((i*36+51))) | |
done | |
color {232..255} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment