show-colors: no need for wonky syntax

master
an 2019-08-15 23:38:54 -04:00
parent 723a1072af
commit 980b80fc9f
1 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ function show-colors -d "Displays all of the terminal colors"
set name name$mode set name name$mode
printf "Mode %2d: " $mode printf "Mode %2d: " $mode
for bg in 49 (seq 40 47) for bg in 49 (seq 40 47)
echo -n \e"[$mode;$bg""mlorem" echo -n \e"[$mode;"$bg"mlorem"
end end
echo \e"[0m" \($$name\) echo \e"[0m" \($$name\)
end end
@ -46,7 +46,7 @@ function show-colors -d "Displays all of the terminal colors"
echo "4 bit color" echo "4 bit color"
for bg in 49 (seq 40 47) for bg in 49 (seq 40 47)
for fg in 39 (seq 30 37) for fg in 39 (seq 30 37)
echo -n \e"[$mode;$bg;$fg""m$mode;$bg;$fg" echo -n \e"[$mode;$bg;"$fg"m$mode;$bg;$fg"
end end
echo \e"[0m" echo \e"[0m"
end end
@ -54,17 +54,17 @@ function show-colors -d "Displays all of the terminal colors"
echo "8 bit color" echo "8 bit color"
for fg in (seq 0 15) for fg in (seq 0 15)
echo -n \e"[48;5;$fg""m " echo -n \e"[48;5;"$fg"m "
end end
echo \e"[0m" echo \e"[0m"
for fg in (seq 232 255) for fg in (seq 232 255)
echo -n \e"[48;5;$fg""m " echo -n \e"[48;5;"$fg"m "
end end
echo \e"[0m" echo \e"[0m"
for fg in (seq 16 231) for fg in (seq 16 231)
echo -n \e"[48;5;$fg""m " echo -n \e"[48;5;"$fg"m "
test (math \( $fg - 15 \) % 36) -eq 0 test (math \( $fg - 15 \) % 36) -eq 0
and echo \e"[0m" and echo \e"[0m"
end end
@ -77,7 +77,7 @@ function show-colors -d "Displays all of the terminal colors"
echo "24 bit color" echo "24 bit color"
for fg in $roygcbvp for fg in $roygcbvp
echo -n \e"[48;2;$fg""m " echo -n \e"[48;2;"$fg"m "
end end
echo \e"[0m" echo \e"[0m"