1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-13 20:29:02 -08:00
rc/sh/colors

15 lines
561 B
Text
Raw Normal View History

2013-06-28 05:22:14 -07:00
#!/usr/bin/env bash
# YES_ZSH YES_BASH NO_DASH 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.
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
###
### ![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
}
[ -n "${preload+-}" ] || colors "$@"