1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-15 08:43:32 -07:00
rc/sh/colors

18 lines
568 B
Plaintext
Raw Normal View History

2013-06-28 05:22:14 -07:00
#!/usr/bin/env bash
2021-07-29 00:37:35 -07:00
# YES_ZSH
# YES_BASH
# NO_DASH
2021-09-23 06:48:05 -07:00
# NO_ASH
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.
2022-03-18 04:26:30 -07:00
### excluding boilerplate, this script is a mere 76 characters long!
2021-08-01 08:14:25 -07:00
###
### ![terminal colors](https://eaguru.guru/t/terminal-colors.png)
2021-07-30 12:36:50 -07:00
[ $# -eq 0 ] || { printf "%s\n" "$0: does not take arguments" >&2; return 1; }
2021-07-29 00:37:35 -07:00
printf "\e[%dm$(printf " \e[%dm mV \e[40m" {4,10}{0..7})\e[0m\n" {3,9}{0..7}
}
[ -n "${preload+-}" ] || colors "$@"