false case scenario

This commit is contained in:
pvincent
2026-07-18 00:50:56 +04:00
parent 43f28765a9
commit 89f2bece87
3 changed files with 86 additions and 58 deletions
+6 -2
View File
@@ -25,7 +25,7 @@ BG_COLORS["BLUE"]='\e[44m'
BG_COLORS["PURPLE"]='\e[45m'
BG_COLORS["CYAN"]='\e[46m'
BG_COLORS["WHITE"]='\e[47m'
BG_COLORS["GRAY"]='\e[90m'
# BG_COLORS["GRAY"]='\e[90m'
# BG_COLORS["MAGENTA"]='\e[95m'
# FUNCTIONS
@@ -55,7 +55,11 @@ function _style_fg {
}
function _style_bg {
[[ -n $1 ]] && echo "${BG_COLORS[$1]}" || true
if [[ -n "$1" ]]; then
[[ -v BG_COLORS[$1] ]] && echo "${BG_COLORS[$1]}" && return
>&2 echo "unknown BG value: $1"
false
fi
}
function style_ansi {