1
0
Fork 0

Fix ordering of color array definition

main
Marissa Staib 5 years ago committed by GitHub
parent f72d849865
commit f14b12efb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      .tmux.status-helpers.sh

@ -2,10 +2,6 @@
# helpers for tmux status line scripts
function get_bgcolor_gradient_red_to_cyan() {
local curval=${1:-0}
local maxval=${2:-100}
local maxindex=$(( ${#colors[@]} - 1 ))
local index=$(( (curval * maxindex) / maxval ))
local -a colors
colors=(
196 # red
@ -16,6 +12,10 @@ function get_bgcolor_gradient_red_to_cyan() {
047 048 049 050 # green-cyans
051 # cyan
)
local curval=${1:-0}
local maxval=${2:-100}
local maxindex=$(( ${#colors[@]} - 1 ))
local index=$(( (curval * maxindex) / maxval ))
if [[ $index -gt $maxindex ]]; then
index=$maxindex
elif [[ $index -lt 0 ]]; then

Loading…
Cancel
Save