added 'no color' code to end of ansi color outs to avoid fucking up terminals

This commit is contained in:
iou1name 2017-11-28 02:11:59 -05:00
parent 646e876528
commit 50c780969d

View File

@ -142,7 +142,11 @@ def colorize(chars, image, code):
new_row += prefix[code] + char_color(image.getpixel((k,j)), code) new_row += prefix[code] + char_color(image.getpixel((k,j)), code)
new_row += chars[j][k] new_row += chars[j][k]
chars[j] = new_row chars[j] = new_row
return "\n".join(chars)
chars = "\n".join(chars)
if code == "ansi":
chars += "\033[0m"
return chars
def image_to_ascii(image, reverse=False, colors=None): def image_to_ascii(image, reverse=False, colors=None):