From 4f61f09d474cf14b97d31e6f59ffc263ca17b68c Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Fri, 23 Dec 2011 23:37:39 -0600 Subject: [PATCH] Add bin/colordump --- bin/colordump | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/colordump diff --git a/bin/colordump b/bin/colordump new file mode 100755 index 0000000..c2661a4 --- /dev/null +++ b/bin/colordump @@ -0,0 +1,19 @@ +#!/bin/sh +# Usage: colordump +# Dump 256 ansi colors to the terminal. + +printf "How each ANSI color is displayed on your terminal:\n\n" + +i=0 +row=0 +while [ $i -lt 255 ]; +do + newrow=$(expr $i / 10) + test $newrow -ne $row && printf "\n" + row=$newrow + printf "\e[%dm %03d \e[0m" $i $i + i=$(expr $i + 1) +done + +printf '\n\n e.g., "\\e[41mTEXT\\e[0m" ' +printf "\e[41m(for TEXT like this)\e[0m\n" -- 2.43.0