From fe8eddf72621d5a172a9674e32acbfadbe3b0896 Mon Sep 17 00:00:00 2001 From: Candifloss Date: Mon, 16 Dec 2024 05:29:14 +0000 Subject: [PATCH] Add ANSI/ansi_colors.sh --- ANSI/ansi_colors.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ANSI/ansi_colors.sh diff --git a/ANSI/ansi_colors.sh b/ANSI/ansi_colors.sh new file mode 100644 index 0000000..fb633d4 --- /dev/null +++ b/ANSI/ansi_colors.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Print ANSI color codes + +count=0 +for i in {0..255}; do + # Print the color-coded number, padded to 3 digits + printf "\033[38;5;${i}m%3d\033[0m " $i + + # After printing 16 numbers, start a new line + ((count++)) + if ((count == 16)); then + echo + count=0 + fi +done \ No newline at end of file