print_style() {
if [ "$2" == "info" ]; then
COLOR="96m"
elif [ "$2" == "success" ]; then
COLOR="92m"
elif [ "$2" == "warning" ]; then
COLOR="93m"
elif [ "$2" == "danger" ]; then
COLOR="91m"
elif [ "$2" == "error" ]; then
COLOR="41m"
else #default color
COLOR="0m"
fi
STARTCOLOR="\e[$COLOR"
ENDCOLOR="\e[0m"
printf "$STARTCOLOR%b$ENDCOLOR" "$1"
}
print_style "Some error" "danger";