Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions shml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ dialog() {
# Foreground (Text)
##
fgcolor() {
local __seq_start='\['
local __seq_end='\]'
local __end='\033[39m'
local __color=$__end # end by default
case "$1" in
Expand All @@ -151,9 +153,9 @@ fgcolor() {
white|ffffff|fff) __color='\033[97m';;
esac
if test "$2"; then
echo -en "$__color$2$__end"
echo -en "$__seq_start$__color$2$__end$__seq_end"
else
echo -en "$__color"
echo -en "$__seq_start$__color$__seq_end"
fi
}

Expand All @@ -174,6 +176,8 @@ c() {
# Background
##
bgcolor() {
local __seq_start='\['
local __seq_end='\]'
local __end='\033[49m'
local __color=$__end # end by default
case "$1" in
Expand All @@ -197,9 +201,9 @@ bgcolor() {
esac

if test "$2"; then
echo -en "$__color$2$__end"
echo -en "$__seq_start$__color$2$__end$__seq_end"
else
echo -en "$__color"
echo -en "$__seq_start$__color$__seq_end"
fi
}

Expand Down