OB title font color only black and white

This commit is contained in:
Daniel Napora 2023-08-03 01:28:41 +02:00
parent 3a7535cc1e
commit d4fd63c54b
2 changed files with 27 additions and 17 deletions

View File

@ -190,9 +190,9 @@ activegradient () {
# calculate color for title.fg and buttons
TITLE_FG=$(pastel textcolor ${2}|pastel format hex)
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
TITLE_FG="#EEEEEE"
TITLE_FG="#E5E5E5"
else
TITLE_FG="#111111"
TITLE_FG="#222222"
fi
sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC}
@ -201,7 +201,7 @@ activegradient () {
# Shadow
read SHADOW <<< "$(grep .active.label.text.font: ${THEMERC} | cut -d':' -f2| cut -d'=' -f2)"
if [ "$SHADOW" == "y" ];then
if [ "$TITLE_FG" == "#EEEEEE" ];then
if [ "$TITLE_FG" == "#E5E5E5" ];then
shadow dark
else
shadow light
@ -254,9 +254,9 @@ clractivebg_only () {
# calculate color for title.fg and buttons
TITLE_FG=$(pastel textcolor ${1}|pastel format hex)
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
TITLE_FG="#EEEEEE"
TITLE_FG="#E5E5E5"
else
TITLE_FG="#111111"
TITLE_FG="#222222"
fi
sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC}
@ -288,9 +288,9 @@ clractivebg () {
# calculate color for title.fg and buttons
TITLE_FG=$(pastel textcolor ${colorTo}|pastel format hex)
if [[ "${TITLE_FG}" == *"ffffff"* ]];then
TITLE_FG="#EEEEEE"
TITLE_FG="#E5E5E5"
else
TITLE_FG="#111111"
TITLE_FG="#222222"
fi
sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC}
@ -379,10 +379,16 @@ ndslimc() {
activebuttonscolors () {
sd "^window.active.button.*.unpressed.image.color:.*$" "window.active.button.*.unpressed.image.color: ${1}" ${THEMERC}
# Calculate colors for other button states (mix of ${1} and clractivebg
read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
hover=$(pastel mix -f 0.2 "${1}" "${ABG}"|pastel format hex)
#read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)"
#hover=$(pastel mix -f 0.2 "${1}" "${ABG}"|pastel format hex)
#pressed=$()
#disabled=$()
if [[ "${1}" == *"E5E5E5"* ]];then
hover="#FFFFFF"
else
hover="#000000"
fi
#notify-send.sh "${1}" "${hover}"
sd "^window.active.button.*.hover.image.color:.*$" "window.active.button.*.hover.image.color: ${hover}" ${THEMERC}
}
fontfamily () {

View File

@ -256,11 +256,13 @@ case "$1" in
obtctl clractivebg ${w[2]}
TITLE_FG=$(pastel textcolor ${w[2]}|pastel format hex)
if [[ "$TITLE_FG" == *"ffffff"* ]];then
obtctl activetextcolor ${w[-1]}
obtctl activebuttonscolors ${w[-1]}
obtctl activetextcolor "#E5E5E5"
#obtctl activetextcolor ${w[-1]}
#obtctl activebuttonscolors ${w[-1]}
else
obtctl activetextcolor ${w[0]}
obtctl activebuttonscolors ${w[0]}
obtctl activetextcolor "#222222"
#obtctl activetextcolor ${w[0]}
#obtctl activebuttonscolors ${w[0]}
fi
obtctl clractivebgto ${w[4]}
obtctl clrnormalbg ${w[0]}
@ -270,11 +272,13 @@ case "$1" in
obtctl clractivebg ${w[-2]}
TITLE_FG=$(pastel textcolor ${w[-2]}|pastel format hex)
if [[ "$TITLE_FG" == *"ffffff"* ]];then
obtctl activetextcolor ${w[-1]}
obtctl activebuttonscolors ${w[-1]}
obtctl activetextcolor "#E5E5E5"
#obtctl activetextcolor ${w[-1]}
#obtctl activebuttonscolors ${w[-1]}
else
obtctl activetextcolor ${w[0]}
obtctl activebuttonscolors ${w[0]}
obtctl activetextcolor "#222222"
#obtctl activetextcolor ${w[0]}
#obtctl activebuttonscolors ${w[0]}
fi
obtctl clractivebgto ${w[-4]}
obtctl clrnormalbg ${w[1]}