Merge pull request #1667 from phreakocious/color_fix

fix  __color_rgb function to properly compare r,g,b as variables
pull/1671/head
Nils Winkler 2020-10-02 10:28:00 +02:00 committed by GitHub
commit 29951e6f9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ function __color_white {
function __color_rgb {
r=$1 && g=$2 && b=$3
[[ r == g && g == b ]] && echo $(( $r / 11 + 232 )) && return # gray range above 232
[[ $r == $g && $g == $b ]] && echo $(( $r / 11 + 232 )) && return # gray range above 232
echo "8;5;$(( ($r * 36 + $b * 6 + $g) / 51 + 16 ))"
}