_CC() { local f="39" local b="49" local s="0" if [ "$1" ]; then f="${1}" fi if [ "$2" ]; then b="${2}" fi if [ "$3" ]; then s="${3}" fi echo "\[\e[${s};${b};${f}m\]" } _CFG() { local f="39" if [ "$1" ]; then f="${1}" fi echo "\[\e[${f}m\]" } _CBG2FG() { case "$1" in $BG_DEFAULT) echo $DEFAULT ;; $BG_BLACK) echo $BLACK ;; $BG_RED) echo $RED ;; $BG_GREEN) echo $GREEN ;; $BG_YELLOW) echo $YELLOW ;; $BG_BLUE) echo $BLUE ;; $BG_PURPLE) echo $PURPLE ;; $BG_CYAN) echo $CYAN ;; $BG_GREY) echo $GREY ;; $BG_DGREY) echo $DGREY ;; $BG_LRED) echo $LRED ;; $BG_LGREEN) echo $LGREEN ;; $BG_LYELLOW) echo $LYELLOW ;; $BG_LBLUE) echo $LBLUE ;; $BG_LPURPLE) echo $LPURPLE ;; $BG_LCYAN) echo $LCYAN ;; $BG_WHITE) echo $WHITE ;; *) echo $1 ;; esac } DEFAULT='39' BLACK='30' RED='31' GREEN='32' YELLOW='33' BLUE='34' PURPLE='35' CYAN='36' GREY='37' DGREY='90' LRED='91' LGREEN='92' LYELLOW='93' LBLUE='94' LPURPLE='95' LCYAN='96' WHITE='97' BG_DEFAULT='49' BG_BLACK='40' BG_RED='41' BG_GREEN='42' BG_YELLOW='43' BG_BLUE='44' BG_PURPLE='45' BG_CYAN='46' BG_GREY='47' BG_DGREY='100' BG_LRED='101' BG_LGREEN='102' BG_LYELLOW='103' BG_LBLUE='104' BG_LPURPLE='105' BG_LCYAN='106' BG_WHITE='107' #NORMAL="\[\033[0m\]" NORMAL="\[\e[0m\]" CLEAR=$(_CFG $DEFAULT)