From 78042caa5026287eb6e775b5c9293f26b770db18 Mon Sep 17 00:00:00 2001 From: Archund Date: Sat, 13 Oct 2018 17:02:38 -0500 Subject: [PATCH] added colors.sh to showcase the use of ansiConfig --- scripts/colors.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/colors.sh diff --git a/scripts/colors.sh b/scripts/colors.sh new file mode 100755 index 0000000..a38b894 --- /dev/null +++ b/scripts/colors.sh @@ -0,0 +1,25 @@ +#!/bin/bash +options +#STATICthis script sources ansiConfig to set up color variables +. ansiConfig.sh + +#-------------------------------------- + +#set up colors + +defineANSI + +#use 'echo -e' or printf to parse escape sequences properly +echo -e "${FYLLW}Print colored text with ANSi escape codes! ${RESET}" +echo -e "${BWHITE}${FBLUE}You can define both foreground or background colors ${RESET}" +echo -e "${BCYAN}${FBLACK}Some terminals ${BOLDON}support${BOLDOFF} ${INVON}special${INVOFF} ${ITALON}format${ITALOFF} ${BLINK}options${STATIC}.${RESET}\n\n" + + +color="echo -e" +$color "You can set up a shortcut for ${ITALON}'echo -e'${ITALOFF} or ${ITALON}'echo -en'${ITALOFF}" +$color "${ITALON}\tcolor=\"echo -e\"${ITALOFF}" +$color "${ITALON}\t\$color \"\${BOLDON}BOLDSTRING\${BOLDOFF}\"${ITALOFF}" + + + +echo -e "\n\nDont forget to ${RESET}RESET the colors\n" \ No newline at end of file