2020-03-08 23:53:14 +00:00
|
|
|
|
# Determine if terminal is capable of showing colors
|
2022-03-12 05:58:46 +00:00
|
|
|
|
if ([[ -t 1 ]] && [[ $(tput colors) -ge 8 ]]) || [[ "${WEBCALL}" ]]; then
|
2017-09-05 13:28:33 +00:00
|
|
|
|
# Bold and underline may not show up on all clients
|
2020-03-08 23:53:14 +00:00
|
|
|
|
# If something MUST be emphasized, use both
|
2017-09-05 13:28:33 +00:00
|
|
|
|
COL_BOLD='[1m'
|
|
|
|
|
COL_ULINE='[4m'
|
|
|
|
|
|
2017-06-21 11:49:05 +00:00
|
|
|
|
COL_NC='[0m'
|
2017-09-05 13:28:33 +00:00
|
|
|
|
COL_GRAY='[90m'
|
|
|
|
|
COL_RED='[91m'
|
|
|
|
|
COL_GREEN='[32m'
|
|
|
|
|
COL_YELLOW='[33m'
|
|
|
|
|
COL_BLUE='[94m'
|
|
|
|
|
COL_PURPLE='[95m'
|
|
|
|
|
COL_CYAN='[96m'
|
|
|
|
|
else
|
|
|
|
|
# Provide empty variables for `set -u`
|
|
|
|
|
COL_BOLD=""
|
|
|
|
|
COL_ULINE=""
|
|
|
|
|
|
|
|
|
|
COL_NC=""
|
|
|
|
|
COL_GRAY=""
|
|
|
|
|
COL_RED=""
|
|
|
|
|
COL_GREEN=""
|
|
|
|
|
COL_YELLOW=""
|
|
|
|
|
COL_BLUE=""
|
|
|
|
|
COL_PURPLE=""
|
|
|
|
|
COL_CYAN=""
|
2017-06-21 11:49:05 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2017-09-05 13:28:33 +00:00
|
|
|
|
# Deprecated variables
|
|
|
|
|
COL_WHITE="${COL_BOLD}"
|
|
|
|
|
COL_BLACK="${COL_NC}"
|
|
|
|
|
COL_LIGHT_BLUE="${COL_BLUE}"
|
|
|
|
|
COL_LIGHT_GREEN="${COL_GREEN}"
|
|
|
|
|
COL_LIGHT_CYAN="${COL_CYAN}"
|
|
|
|
|
COL_LIGHT_RED="${COL_RED}"
|
|
|
|
|
COL_URG_RED="${COL_RED}${COL_BOLD}${COL_ULINE}"
|
|
|
|
|
COL_LIGHT_PURPLE="${COL_PURPLE}"
|
|
|
|
|
COL_BROWN="${COL_YELLOW}"
|
|
|
|
|
COL_LIGHT_GRAY="${COL_GRAY}"
|
|
|
|
|
COL_DARK_GRAY="${COL_GRAY}"
|
|
|
|
|
|
|
|
|
|
TICK="[${COL_GREEN}✓${COL_NC}]"
|
|
|
|
|
CROSS="[${COL_RED}✗${COL_NC}]"
|
2017-06-21 11:49:05 +00:00
|
|
|
|
INFO="[i]"
|
|
|
|
|
QST="[?]"
|
2017-09-05 13:28:33 +00:00
|
|
|
|
DONE="${COL_GREEN} done!${COL_NC}"
|
|
|
|
|
OVER="\\r[K"
|