Fix transparency problem with alert icons
This commit is contained in:
parent
c674f97f50
commit
6b7e277f84
@ -94,7 +94,7 @@ class AlertsModule:
|
||||
if alert["icon"] is not None:
|
||||
if callable(alert["icon"]):
|
||||
icon_img = alert["icon"](size=int(font_size*self.icon_size/16))
|
||||
image.paste(icon_img, (int(self.icon_size / 2 - font_size*self.icon_size/32), align), icon_img)
|
||||
image.paste(icon_img, (int(self.icon_size / 2 - font_size*self.icon_size/32), align))
|
||||
else:
|
||||
color_img = Image.new('RGB', (self.icon_size, self.icon_size), "#fff")
|
||||
icon_img = Image.open("icons/" + alert["icon"]).resize((self.icon_size, self.icon_size))
|
||||
|
@ -130,7 +130,7 @@ class RATPWeatherModule:
|
||||
|
||||
def alert_icon(mode, line):
|
||||
def icon(size=64):
|
||||
image = Image.new('RGBA', (size, size), '#0000')
|
||||
image = Image.new('RGB', (size, size), '#000')
|
||||
|
||||
white = Image.new('RGB', (int(size / 2), int(size / 2)), '#fff')
|
||||
mode_icon = Image.open("icons/" + mode + ".png").resize((int(size/2), int(size/2)))
|
||||
|
Loading…
Reference in New Issue
Block a user