aboutsummaryrefslogtreecommitdiffstats
path: root/cli/colortest.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-03-31 10:57:34 +0800
committerAaron LI <aaronly.me@gmail.com>2016-03-31 10:57:34 +0800
commitc9c896dea2ba43551c4e10bd49666105449e9bd7 (patch)
treee94b73f17b2d776c2acd4c9549657f500c3dc7ce /cli/colortest.py
parent2b6cb9b655a53d43b32a8a211287c82f4f59999a (diff)
downloadatoolbox-c9c896dea2ba43551c4e10bd49666105449e9bd7.tar.bz2
add all scripts/tools
Diffstat (limited to 'cli/colortest.py')
-rwxr-xr-xcli/colortest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/colortest.py b/cli/colortest.py
new file mode 100755
index 0000000..2d29590
--- /dev/null
+++ b/cli/colortest.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+#
+# http://askubuntu.com/questions/27314/script-to-display-all-terminal-colors
+
+import sys
+
+terse = "-t" in sys.argv[1:] or "--terse" in sys.argv[1:]
+
+for i in range(2 if terse else 10):
+ for j in range(30, 38):
+ for k in range(40, 48):
+ if terse:
+ print "\33[%d;%d;%dm%d;%d;%d\33[m " % (i, j, k, i, j, k),
+ else:
+ print ("%d;%d;%d: \33[%d;%d;%dm Hello, World! \33[m " %
+ (i, j, k, i, j, k, ))
+ print
+