summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-11-03 19:23:07 +0000
committerBlake Romero <blake@blkrom.com>2024-11-03 23:44:05 +0000
commit0925e11ec29a13910fc0a1d904b9b9b1cb4cd604 (patch)
treefc8d410bec636f287fa9934daf43451d27fa3a87
parent201497a648688c3f1c6f31ff213e4cbe0619b3db (diff)
Add printcol script
-rwxr-xr-xprintcol.sh24
1 files changed, 24 insertions, 0 deletions
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