Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 70 lines (63 sloc) 1.37 kB
#!/usr/bin/env bash
# set colors, separate multiple selections with coma, order is not important
# using bold in one definition requires resetting it in others with offbold
# using background in one color requires resetting it in others with bdefault
# example:
# rvm_error_color=bold,red
# rvm_notify_color=offbold,green
case "${TERM:-dumb}" in
(dumb|unknown) exit 0 ;;
esac
builtin command -v tput >/dev/null && tput sgr0 >/dev/null || exit 0
for color in ${1//,/ }
do
case "${color:-}" in
# regular colors
black) tput setaf 0
;;
red) tput setaf 1
;;
green) tput setaf 2
;;
yellow) tput setaf 3
;;
blue) tput setaf 4
;;
magenta) tput setaf 5
;;
cyan) tput setaf 6
;;
white) tput setaf 7
;;
# emphasized (bolded) colors
bold) tput smso
;;
offbold) tput rmso
;;
# background colors
bblack) tput setab 0
;;
bred) tput setab 1
;;
bgreen) tput setab 2
;;
byellow) tput setab 3
;;
bblue) tput setab 4
;;
bmagenta) tput setab 5
;;
bcyan) tput setab 6
;;
bwhite) tput setab 7
;;
# Defaults
default) tput setaf 9
;;
bdefault) tput setab 9
;;
# Reset
*) tput sgr0
;;
esac
done
Jump to Line
Something went wrong with that request. Please try again.