mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
@ -10,13 +10,17 @@ class Widget(object):
|
|||||||
def draw(self, canvas, drawer):
|
def draw(self, canvas, drawer):
|
||||||
raise Exception("not implemented")
|
raise Exception("not implemented")
|
||||||
|
|
||||||
|
# canvas.paste: https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.paste
|
||||||
|
# takes mask variable, to identify color system. (not used for pwnagotchi yet)
|
||||||
|
# Pwn should use "1" since its mainly black or white displays.
|
||||||
class Bitmap(Widget):
|
class Bitmap(Widget):
|
||||||
def __init__(self, path, xy, color=0):
|
def __init__(self, path, xy, color=0):
|
||||||
super().__init__(xy, color)
|
super().__init__(xy, color)
|
||||||
self.image = Image.open(path)
|
self.image = Image.open(path)
|
||||||
|
|
||||||
def draw(self, canvas, drawer):
|
def draw(self, canvas, drawer):
|
||||||
|
if self.color = 0xFF:
|
||||||
|
self.image = ImageOps.invert(self.image)
|
||||||
canvas.paste(self.image, self.xy)
|
canvas.paste(self.image, self.xy)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user