From f14b12efb93e3f96c04534dbf5a55b1089151c4a Mon Sep 17 00:00:00 2001 From: Marissa Staib Date: Wed, 25 Sep 2019 16:37:03 -0400 Subject: [PATCH] Fix ordering of color array definition --- .tmux.status-helpers.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.tmux.status-helpers.sh b/.tmux.status-helpers.sh index 8cfb001..210a34a 100644 --- a/.tmux.status-helpers.sh +++ b/.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