-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcolorize
More file actions
33 lines (25 loc) · 761 Bytes
/
colorize
File metadata and controls
33 lines (25 loc) · 761 Bytes
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
33
colored () {
local CLR="$1"
shift
echo -e "\033[${CLR}m$@\033[00m";
}
red () { colored "0;31" "$@"; }
red_bold () { colored "1;31" "$@"; }
purple () { colored "0;35" "$@"; }
purple_bold () { colored "1;35" "$@"; }
blue () { colored "0;34" "$@"; }
blue_bold () { colored "1;34" "$@"; }
yellow () { colored "0;33" "$@"; }
yellow_bold () { colored "1;33" "$@"; }
green () { colored "0;32" "$@"; }
green_bold () { colored "1;32" "$@"; }
black () { colored "0;30" "$@"; }
gray () { colored "1;30" "$@"; }
# not promised - depends on term config?
#white () { colored "0;37" "$@"; }
#white_bold () { colored "1;37" "$@"; }
error() { red_bold "$@"; }
warn() { red "$@"; }
info() { yellow_bold "$@"; }
notice() { green "$@"; }
debug() { gray "$@"; }