diff options
author | jaseg <jaseg@jaseg.net> | 2014-01-03 13:19:44 +0100 |
---|---|---|
committer | jaseg <jaseg@jaseg.net> | 2014-01-03 13:19:44 +0100 |
commit | 9ef5c135e894b2da95940e2556f4df9ce2205552 (patch) | |
tree | 3e6538ec4ac69caa9f4db16dad36265fcf5637eb /host/genpal.py | |
parent | 3fd92ee838b39de097ce2b03ebdd37659708e157 (diff) | |
download | matelight-9ef5c135e894b2da95940e2556f4df9ce2205552.tar.gz matelight-9ef5c135e894b2da95940e2556f4df9ce2205552.tar.bz2 matelight-9ef5c135e894b2da95940e2556f4df9ce2205552.zip |
Re-organized the host software directory layout
Diffstat (limited to 'host/genpal.py')
-rwxr-xr-x | host/genpal.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/host/genpal.py b/host/genpal.py new file mode 100755 index 0000000..01fe611 --- /dev/null +++ b/host/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)) |