fix __color_rgb function to properly compare r,g,b as variables and not lettersg

This commit is contained in:
phreakocious
2020-09-30 22:09:42 -07:00
parent 49a021ebd8
commit 5e101fce34

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 ))"
}