]>
git.wh0rd.org - home.git/blob - .bin/bash-colors
2 # Author: Mike Frysinger <vapier@gmail.com>; released into the public domain; suck it.
10 BRACKET
="\$'\e[34;01m'"
13 for c
in "${colors[@]}" ; do
14 [[ -t 0 ]] || c
="${c%=*}="
20 if [[ ${TERM} != *-256color ]] ; then
22 echo "warning: TERM (${TERM}) does not end in '-256color';"
23 echo "warning: trying to use 256 colors might not work."
29 echo -e '\e['"${1};${2}mthis color is: \\\\e[${1};${2}m \e[0m"
39 for j
in {30.
.37} ; do
46 for n
in {16.
.231} ; do
47 showit
"38;05" $
(printf '%03i' ${n})
52 for n
in {232.
.255} ; do
57 for x
in system cube gray
; do
62 ncurses|curses|mutt|nano
)
75 blackfg
=$
(tput setaf
0)
76 for seta
in "af" "ab" ; do
77 [[ ${seta} == "af" ]] && ground
=fore || ground
=back
78 for pfx
in "" "bright" ; do
79 for (( i
= 0; i
< ${#colors[@]}; ++i
)) ; do
80 [[ ${pfx} == "bright" ]] && printf "${bold}"
81 [[ ${seta} == "ab" ]] && printf "${blackfg}"
82 echo "$(tput set${seta} ${i})this is ${ground}ground color '${pfx}${colors[i]}'${norm}"
92 - --env - show env you can eval in a shell
93 - 16, system - show basic colors (default)
94 - cube, 6x6x6 - show most extended colors
95 - gray - show gray scale
96 - all, 256 - show all colors
97 - curses - show ncurses color names (used by mutt, nano, etc...)