@kecan0406/ttheme 1.2.17 → 1.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
4
4
  "gate": [
5
5
  {
6
6
  "rule": "foreground",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kecan0406/ttheme",
3
- "version": "1.2.17",
3
+ "version": "1.2.18",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ttheme": "bin/ttheme.js"
@@ -620,7 +620,7 @@ __tt_pv_bg_recolor() {
620
620
  }
621
621
 
622
622
  __tt_pv_bg_panel() {
623
- local name=$1 z=$'\e[0m' b=$'\e[1m' d=$'\e[2m' c=$ac val sty mark choice REPLY
623
+ local name=$1 z=$TTHEME_SGR[reset] b=$TTHEME_SGR[bold] d=$TTHEME_SGR[dim] c=$ac val sty mark choice REPLY
624
624
  local -a labs=(Size Position Opacity Colors) at=(1 4 7 0) def=(${=bgdef[$1]})
625
625
  local -i r0=$2 col=$3 end=$4 off=${bgoff[$1]} T=$(( $4 - $3 - 21 )) lo=100 hi=100 k i r knob pos=${bgpos[$1]} o tuned
626
626
  (( color )) || z= b= d= c=
@@ -650,7 +650,7 @@ __tt_pv_bg_panel() {
650
650
  elif [[ $choice != $val ]]; then
651
651
  out+=$d" $choice "$z" "
652
652
  elif (( tf == k && ! off )); then
653
- out+=$'\e[7;1m'$c" $choice "$z" "
653
+ out+=$pl" $choice "$z" "
654
654
  else
655
655
  out+=$sty" $choice "$z" "
656
656
  fi
@@ -710,7 +710,7 @@ __tt_pv_bg_panel() {
710
710
  }
711
711
 
712
712
  __tt_pv_bg_strip() {
713
- local pal=$tune dir=${TTHEME_CONFIG:h}/backgrounds cur fill want sty top side bot cmd buf="" z=$'\e[0m' d=$'\e[2m' REPLY
713
+ local pal=$tune dir=${TTHEME_CONFIG:h}/backgrounds cur fill want sty top side bot cmd buf="" z=$TTHEME_SGR[reset] d=$TTHEME_SGR[dim] REPLY
714
714
  local -a keys=(${=bgpics[$tune]}) wh pd
715
715
  local -i r0=$1 col=$2 end=$3 n=${#keys} at show tc tr=3 i k x r id slot first
716
716
  if (( n < 1 )); then
@@ -741,7 +741,7 @@ __tt_pv_bg_strip() {
741
741
  x=$(( col + i * (tc + 3) ))
742
742
  slot=$(( i + 1 ))
743
743
  if (( k == at )); then
744
- sty=$'\e[1m'$ac top="┏${(l:tc::━:)}┓" side="┃" bot="┗${(l:tc::━:)}┛"
744
+ sty=$TTHEME_SGR[bold]$ac top="┏${(l:tc::━:)}┓" side="┃" bot="┗${(l:tc::━:)}┛"
745
745
  else
746
746
  sty=$d top="╭${(l:tc::─:)}╮" side="│" bot="╰${(l:tc::─:)}╯"
747
747
  fi
@@ -816,7 +816,7 @@ __tt_pv_bg_save() {
816
816
  note="Background · $name $REPLY"
817
817
  fi
818
818
  if __tt_color; then
819
- printf '\033[2m%s\033[0m\n' "$note"
819
+ printf "${TTHEME_SGR[dim]}%s${TTHEME_SGR[reset]}\n" "$note"
820
820
  else
821
821
  print -r -- "$note"
822
822
  fi