From 7a707c20aa710b142b7b47f5a82da626cbc51931 Mon Sep 17 00:00:00 2001 From: Mohammad AlSaleh Date: Sat, 13 Jan 2024 07:12:01 +0300 Subject: [PATCH] ansi-colors.sh: Add dim colors Signed-off-by: Mohammad AlSaleh --- ansi-colors.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ansi-colors.sh b/ansi-colors.sh index 63f7251..1f506ef 100755 --- a/ansi-colors.sh +++ b/ansi-colors.sh @@ -11,14 +11,31 @@ printf "\n" for foreground in $(seq 0 15) do + # Add each dim color right above corresponding normal color for easier visual comparisons + if ((foreground < 8)) + then + printf "d%d:" "${foreground}" + printf "\x1B[2;$((foreground+30))m" + + for background in $(seq 0 15) + do + printf "\x1B[48;5;${background}m" + printf " %2d " "${background}" + printf "\x1B[49m" + done + printf "\x1B[0m" + printf "\n" + fi + printf "%2d:" "${foreground}" printf "\x1B[38;5;${foreground}m" + for background in $(seq 0 15) do printf "\x1B[48;5;${background}m" printf " %2d " "${background}" printf "\x1B[49m" done - printf "\x1B[39m" + printf "\x1B[0m" printf "\n" done