-
Notifications
You must be signed in to change notification settings - Fork 0
/
colors
32 lines (32 loc) · 837 Bytes
/
colors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
COLOR='\033['
case "$0" in
*"red"*) COLOR+='0;31m' ;;
*"orange"*) COLOR+='0;33m' ;;
*"yellow"*) COLOR+='1;33m' ;;
*"green"*) COLOR+='0;32m' ;;
*"blue"*) COLOR+='0;34m' ;;
*"purple"*) COLOR+='0;35m' ;;
*"pink"*) COLOR+='1;35m' ;;
*"white"*) COLOR+='1;37m' ;;
*"cyan"*) COLOR+='0;36m' ;;
*"darkgray"*) COLOR+='1;30m' ;;
*"lightgray"*) COLOR+='0;37m' ;;
*"gray"*) COLOR+='0;37m' ;;
*"lightred"*) COLOR+='1;31m' ;;
*"lightgreen"*) COLOR+='1;32m' ;;
*"lightcyan"*) COLOR+='1;36m' ;;
*"black"*) COLOR+='0;30m' ;;
*) COLOR+='0;31m' ;;
esac
NC='\033[0m' # No Color
ARGS=''
while getopts "n" opt; do
case "$opt" in
n)
shift
echo -e -n "${COLOR}${@}${NC}"
exit
;;
esac
done
echo -e "${COLOR}$@${NC}"