1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-13 20:39:04 -08:00
rc/sh/colors
Connor Olding d5f3f14d72 merge compatibility lines
RIP meaningful last-modified dates
2024-03-26 15:08:14 -07:00

14 lines
562 B
Bash
Executable file

#!/usr/bin/env bash
# YES_ZSH YES_BASH NO_DASH NO_ASH
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!
###
### ![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}
}
[ -n "${preload+-}" ] || colors "$@"