Created
May 19, 2018 09:21
-
-
Save susisu/857bafe383a6a6d8ffded8c32ceea571 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
exit 0; | |
elif [ $# -eq 1 ]; then | |
printf "$@" | |
exit 0 | |
fi | |
msg=${@: -1:1} | |
for i in $(seq $(($# - 1)) 1); do | |
color=${@: $i:1} | |
case $color in | |
bold) msg="\033[1m$msg\033[22m";; | |
dim) msg="\033[2m$msg\033[22m";; | |
italic) msg="\033[3m$msg\033[23m";; | |
underline) msg="\033[4m$msg\033[24m";; | |
blink) msg="\033[5m$msg\033[25m";; | |
inverse) msg="\033[7m$msg\033[27m";; | |
hidden) msg="\033[8m$msg\033[28m";; | |
strike) msg="\033[9m$msg\033[29m";; | |
black) msg="\033[30m$msg\033[39m";; | |
red) msg="\033[31m$msg\033[39m";; | |
green) msg="\033[32m$msg\033[39m";; | |
yellow) msg="\033[33m$msg\033[39m";; | |
blue) msg="\033[34m$msg\033[39m";; | |
magenta) msg="\033[35m$msg\033[39m";; | |
cyan) msg="\033[36m$msg\033[39m";; | |
white) msg="\033[37m$msg\033[39m";; | |
gray) msg="\033[90m$msg\033[39m";; | |
red_bright) msg="\033[91m$msg\033[39m";; | |
green_bright) msg="\033[92m$msg\033[39m";; | |
yellow_bright) msg="\033[93m$msg\033[39m";; | |
blue_bright) msg="\033[94m$msg\033[39m";; | |
magenta_bright) msg="\033[95m$msg\033[39m";; | |
cyan_bright) msg="\033[96m$msg\033[39m";; | |
white_bright) msg="\033[97m$msg\033[39m";; | |
bg_black) msg="\033[40m$msg\033[49m";; | |
bg_red) msg="\033[41m$msg\033[49m";; | |
bg_green) msg="\033[42m$msg\033[49m";; | |
bg_yellow) msg="\033[43m$msg\033[49m";; | |
bg_blue) msg="\033[44m$msg\033[49m";; | |
bg_magenta) msg="\033[45m$msg\033[49m";; | |
bg_cyan) msg="\033[46m$msg\033[49m";; | |
bg_white) msg="\033[47m$msg\033[49m";; | |
bg_gray) msg="\033[100m$msg\033[49m";; | |
bg_red_bright) msg="\033[101m$msg\033[49m";; | |
bg_green_bright) msg="\033[102m$msg\033[49m";; | |
bg_yellow_bright) msg="\033[103m$msg\033[49m";; | |
bg_blue_bright) msg="\033[104m$msg\033[49m";; | |
bg_magenta_bright) msg="\033[105m$msg\033[49m";; | |
bg_cyan_bright) msg="\033[106m$msg\033[49m";; | |
bg_white_bright) msg="\033[107m$msg\033[49m";; | |
esac | |
done | |
printf "$msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment