config/bash/colorize.sh

27 lines
422 B
Bash
Raw Normal View History

2017-05-22 17:02:46 +00:00
function colorize() {
local TEXT=$2
local NO_COLOR="\033[0m"
case "$1" in
red)
local COLOR="\033[31m"
;;
green)
local COLOR="\033[32m"
;;
yellow)
local COLOR="\033[33m"
;;
blue)
local COLOR="\033[34m"
;;
magenta)
local COLOR="\033[35m"
;;
cyan)
local COLOR="\033[36m"
;;
esac
echo -e "${COLOR}${TEXT}${NO_COLOR}"
}