From 3c799ae12962ff88d7dd6926fb7bf675a0eff7b1 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 19 Mar 2022 09:12:50 +0100 Subject: [PATCH] ansi-color: Inform about the background option textually --- .config/zsh/functions/ansi-colours | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.config/zsh/functions/ansi-colours b/.config/zsh/functions/ansi-colours index 176a80b..7e27f5b 100644 --- a/.config/zsh/functions/ansi-colours +++ b/.config/zsh/functions/ansi-colours @@ -10,14 +10,12 @@ function _ansi-colors_8() local start="${2}" print "\e[1;97m${title}:\e[0m" - print "Regular Bold Underline Italic Crossed Dim Blinking Reversed Background" + print "Regular Bold Underline Italic Crossed Dim Blinking Reversed" for n in {${start}..$(( ${start}+7 ))}; do - local nbg=$(( ${n}+10 )) print -c "\e[0;${n}m\\\e[0;${n}m\e[m" "\e[1;${n}m\\\e[1;${n}m\e[m" \ "\e[4;${n}m\\\e[4;${n}m\e[m" "\e[3;${n}m\\\e[3;${n}m\e[m" \ "\e[9;${n}m\\\e[9;${n}m\e[m" "\e[2;${n}m\\\e[2;${n}m\e[m" \ - "\e[5;${n}m\\\e[5;${n}m\e[m" \ - "\e[7;${n}m\\\e[7;${n}m\e[m" "\e[${nbg}m\\\e[${nbg}m\e[m" + "\e[5;${n}m\\\e[5;${n}m\e[m" "\e[7;${n}m\\\e[7;${n}m\e[m" done } @@ -35,14 +33,16 @@ function _ansi-colors_256() done print -C 6 -a ${colours} - print "\n\e[1;97m256 colour background:\e[0m 48 instead of 38" - print "\e[1;97mTrue colour:\e[0m \\\e[38;2;\e[0;31mR\e[0m;\e[0;32mG\e[0m;\e[0;34mB\e[0mm" \ + print "\e[1;97mBackground:\e[0m 48 instead of 38" + print "\n\e[1;97mTrue colour:\e[0m \\\e[38;2;\e[0;31mR\e[0m;\e[0;32mG\e[0m;\e[0;34mB\e[0mm" \ "and \\\e[48;2;\e[0;41mR\e[0m;\e[0;42mG\e[0m;\e[0;44mB\e[0mm" } _ansi-colors_8 "Classic colours" 30 -print +print "\e[1;97mBackground:\e[0m 40-47 instead of to 30-37\n" + _ansi-colors_8 "High intensity colours" 90 +print "\e[1;97mBackground:\e[0m 100-107 instead of 90-97" [[ -v 1 && "${1[1]}" == "8" ]] || _ansi-colors_256