2013-06-28 05:22:14 -07:00
|
|
|
#!/usr/bin/env bash
|
2024-07-22 06:54:25 -07:00
|
|
|
# compat: -ash +bash -dash -hush +ksh -mksh -oksh +osh -posh -yash +zsh
|
2021-07-29 00:37:35 -07:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
colors() { ### @-
|
2021-08-01 08:14:25 -07:00
|
|
|
### display all combinations of foreground and background terminal colors.
|
|
|
|
### this only includes the basic 16-color palette.
|
2024-07-12 06:36:05 -07:00
|
|
|
### excluding boilerplate, this script is a mere 67 characters long!
|
2021-08-01 08:14:25 -07:00
|
|
|
###
|
2024-07-12 06:22:33 -07:00
|
|
|
### ![terminal colors](https://eaguru.guru/t/terminal-colors-2024.png)
|
|
|
|
[ $# -eq 0 ] || { printf >&2 '%s: does not take arguments\n' colors; return 64 ;}
|
2024-07-12 06:36:05 -07:00
|
|
|
printf "\e[%dm `echo '\e['{4,10}{0..7}'m mV \e[40m'`\n" {3,9}{0..7}
|
2021-07-29 00:37:35 -07:00
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || colors "$@"
|