This commit is contained in:
Casey 2024-07-08 22:26:27 +03:00
parent 8866e31919
commit 08dec86316
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 4 additions and 8 deletions

View File

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