X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Fc_image.py;h=0959150bd3d300fb6b2a1f07cf18e02bd40a4989;hp=a1395f3acfe53fd81b0561e9a4c5ad833c631fbc;hb=e9c756ae4bdb855d44fba37eb96d97d0b4a971e9;hpb=45ff44d240a2ff4f13c474386afb6f31b6704324 diff --git a/rainbowstream/c_image.py b/rainbowstream/c_image.py index a1395f3..0959150 100644 --- 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] - 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):