projects
/
rainbowstream.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45ff44d
)
Added 24bit color for pixel printing
author
Joseph Hallett
<bogwonch@bogwonch.net>
Thu, 30 Jul 2015 22:37:43 +0000
(23:37 +0100)
committer
Joseph Hallett
<bogwonch@bogwonch.net>
Thu, 30 Jul 2015 22:37:43 +0000
(23:37 +0100)
rainbowstream/c_image.py
patch
|
blob
|
blame
|
history
diff --git
a/rainbowstream/c_image.py
b/rainbowstream/c_image.py
index
a1395f3
..
0959150
100644
(file)
--- a/
rainbowstream/c_image.py
+++ b/
rainbowstream/c_image.py
@@
-29,8
+29,13
@@
def pixel_print(pixel):
Print a pixel with given Ansi color
"""
r, g, b = pixel[:3]
Print a pixel with given Ansi color
"""
r, g, b = pixel[:3]
- ansicolor = rgb2short(r, g, b)
- sys.stdout.write('\033[48;5;%sm \033[0m' % (ansicolor))
+
+ if c['24BIT'] is True:
+ sys.stdout.write('\033[48;2;%d;%d;%dm \033[0m'
+ % (r, g, b))
+ else:
+ ansicolor = rgb2short(r, g, b)
+ sys.stdout.write('\033[48;5;%sm \033[0m' % (ansicolor))
def block_print(higher, lower):
def block_print(higher, lower):