1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 06:29:02 -08:00

update colors script for 2024, shaving 2 chars

This commit is contained in:
Connor Olding 2024-07-12 06:22:33 -07:00
parent eec43d9c43
commit 806f3ec45b

View file

@ -4,11 +4,11 @@
colors() { ### @-
### display all combinations of foreground and background terminal colors.
### this only includes the basic 16-color palette.
### excluding boilerplate, this script is a mere 76 characters long!
### excluding boilerplate, this script is a mere 74 characters long!
###
### ![terminal colors](https://eaguru.guru/t/terminal-colors.png)
[ $# -eq 0 ] || { printf "%s\n" "$0: does not take arguments" >&2; return 1; }
printf "\e[%dm$(printf " \e[%dm mV \e[40m" {4,10}{0..7})\e[0m\n" {3,9}{0..7}
### ![terminal colors](https://eaguru.guru/t/terminal-colors-2024.png)
[ $# -eq 0 ] || { printf >&2 '%s: does not take arguments\n' colors; return 64 ;}
printf "\e[%dm`printf " \e[%dm mV \e[40m" {4,10}{0..7}`\e[m\n" {3,9}{0..7}
}
[ -n "${preload+-}" ] || colors "$@"