2021-10-01 04:02:49 -07:00
|
|
|
#!/usr/bin/env bash
|
2024-07-23 00:04:57 -07:00
|
|
|
# compat: -ash +bash -dash -hush +ksh -mksh -oksh +osh -posh -yash +zsh
|
2021-10-01 04:02:49 -07:00
|
|
|
|
2024-07-23 00:04:57 -07:00
|
|
|
morecolors() ( ### @- print all 256 colors that are available on most terminals.
|
2021-10-01 04:02:49 -07:00
|
|
|
# borrowed from leah2's dotfiles.
|
|
|
|
for i in {0..255}; do
|
|
|
|
printf '\e[48;5;%dm\e[38;5;15m %03d ' $i $i
|
|
|
|
printf '\e[33;5;0m\e[38;5;%dm %03d ' $i $i
|
|
|
|
[ "$(( i+1 <= 16 ? (i+1) % 8 : ( (i+1)-16) % 6 ))" = 0 ] && printf '\e[0m\n'
|
|
|
|
[ "$(( i+1 <= 16 ? (i+1) % 16 : ( (i+1)-16) % 36 ))" = 0 ] && printf '\e[0m\n'
|
|
|
|
done
|
2021-10-13 21:22:56 -07:00
|
|
|
return 0
|
2024-07-23 00:04:57 -07:00
|
|
|
)
|
2021-10-01 04:02:49 -07:00
|
|
|
|
|
|
|
[ -n "${preload+-}" ] || morecolors "$@"
|