aboutsummaryrefslogtreecommitdiff
path: root/host/matelight/genpal.py
diff options
context:
space:
mode:
authorjaseg <jaseg@jaseg.net>2014-01-03 00:10:20 +0100
committerjaseg <jaseg@jaseg.net>2014-01-03 00:10:20 +0100
commit916aced1bef07001ef4eee2a1cde6cd6e33b4bc3 (patch)
treea8af06f0dcc65645801a2e20db64ca877b288f98 /host/matelight/genpal.py
parent34def4f660108632a9526c9ad3195fdb883d206d (diff)
downloadmatelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.gz
matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.bz2
matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.zip
Now with even more abstract art.
Diffstat (limited to 'host/matelight/genpal.py')
-rwxr-xr-xhost/matelight/genpal.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/host/matelight/genpal.py b/host/matelight/genpal.py
new file mode 100755
index 0000000..01fe611
--- /dev/null
+++ b/host/matelight/genpal.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+xterm_colors = [
+ (0x00, 0x00, 0x00),
+ (0xa8, 0x00, 0x00),
+ (0x00, 0xa8, 0x00),
+ (0xa8, 0x54, 0x00),
+ (0x00, 0x00, 0xa8),
+ (0xa8, 0x00, 0xa8),
+ (0x00, 0xa8, 0xa8),
+ (0xa8, 0xa8, 0xa8),
+ (0x54, 0x54, 0x54),
+ (0xfc, 0x54, 0x54),
+ (0x54, 0xfc, 0x54),
+ (0xfc, 0xfc, 0x54),
+ (0x54, 0x54, 0xfc),
+ (0xfc, 0x54, 0xfc),
+ (0x54, 0xfc, 0xfc),
+ (0xfc, 0xfc, 0xfc)]
+
+# colors 16..232: the 6x6x6 color cube
+_valuerange = (0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff)
+for i in range(217):
+ r = _valuerange[(i // 36) % 6]
+ g = _valuerange[(i // 6) % 6]
+ b = _valuerange[i % 6]
+ xterm_colors.append((r, g, b))
+
+# colors 233..253: grayscale
+for i in range(1, 24):
+ v = 8 + i * 10
+ xterm_colors.append((v, v, v))
+
+for r,g,b in xterm_colors:
+ print("\t{{{:#04x}, {:#04x}, {:#04x}}},".format(r,g,b))