diff --git a/async-bot.py b/async-bot.py index 7e50dea..1d19f7a 100644 --- a/async-bot.py +++ b/async-bot.py @@ -65,18 +65,14 @@ class AsyncBotManager: ) as im: draw = ImageDraw.Draw(im) draw.rectangle( - (0, 0, im.width, im.height), (255 if negative else 0, 0) - ) - draw.text( - (left + 2, top + 2), - text, - font=font, - fill=(0 if negative else 255, 0), - anchor="lt", + (0, 0, im.width, im.height), (0, 0) ) + draw.text((left + 2, top + 2), text, font=font, fill=255, anchor="lt") alpha = im.convert("L").filter(ImageFilter.MaxFilter(5)) im.putalpha(alpha) + if negative: + im = ImageChops.invert(im) return im.copy() def get_font(self, font_name: str, size: int = 8):