From 0925e11ec29a13910fc0a1d904b9b9b1cb4cd604 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Sun, 3 Nov 2024 19:23:07 +0000 Subject: Add printcol script --- printcol.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 printcol.sh diff --git a/printcol.sh b/printcol.sh new file mode 100755 index 0000000..4d74f6b --- /dev/null +++ b/printcol.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# +# PRINT COLOURS +# +# DESCRIPTION +# Output 16 or 256 terminal colour codes +# +# ARGS +# 1st arg (optional): print 256 colours +# + +if [[ "$1" == "256" ]]; then + for c in {0..255}; do + tput setaf $c + tput setaf $c | cat -v + echo " = $c" + done +else + for c in {0..15}; do + tput setaf $c + tput setaf $c | cat -v + echo " = $c" + done +fi -- cgit