diff options
author | jaseg <s@jaseg.de> | 2013-07-28 00:19:47 +0200 |
---|---|---|
committer | jaseg <s@jaseg.de> | 2013-07-28 00:19:58 +0200 |
commit | 2a74911541ce65ae566fd5f2a524ae6dcf2b00de (patch) | |
tree | 594c58108a83e066f925a72b4aa3e9651b6e485f /colorcube.py | |
parent | 0995c90cf4e97c6e93f497284304da33e0dd83a4 (diff) | |
download | pixelterm-2a74911541ce65ae566fd5f2a524ae6dcf2b00de.tar.gz pixelterm-2a74911541ce65ae566fd5f2a524ae6dcf2b00de.tar.bz2 pixelterm-2a74911541ce65ae566fd5f2a524ae6dcf2b00de.zip |
Added two useful tools
Diffstat (limited to 'colorcube.py')
-rwxr-xr-x | colorcube.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/colorcube.py b/colorcube.py new file mode 100755 index 0000000..dc84e2e --- /dev/null +++ b/colorcube.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import os, sys, argparse, os.path, json + +reset_sequence = '\033[39;49m' + +def esc(i): + return '\033[48;5;'+str(i)+'m' + +print(''.join([str(i).ljust(4) for i in range(16)])) +print(' '.join([esc(i) for i in range(16)])+' ' + reset_sequence) + +for j in range(6): + for k in range(6): + c = 16+j*6+k*6*6 + print(''.join([str(c+i).ljust(4) for i in range(6)])) + print(' '.join([esc(c+i) for i in range(6)])+' ' + reset_sequence) + +print(''.join([str(i).ljust(4) for i in range(16+6*6*6, 16+6*6*6+24)])) +print(' '.join([esc(i) for i in range(16+6*6*6, 16+6*6*6+24)])+' ' + reset_sequence) + |