From 08dec8631687891f836879959fa03d3cac892af3 Mon Sep 17 00:00:00 2001 From: hkc Date: Mon, 8 Jul 2024 22:26:27 +0300 Subject: [PATCH] Um, yes --- async-bot.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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):