Skip to content

Commit

Permalink
Reimplement the fill function
Browse files Browse the repository at this point in the history
Now exactly tested on my Raspberry Pi, the fill function works and replaces now commit 3165c53 reverted in previous commit (see Commit: 2097022).
  • Loading branch information
RossAdrian committed Aug 5, 2024
1 parent 2097022 commit b436da5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyframebuffer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ def drawPixel(self, x, y, color):
color = getColorValue(color)
fb.pyfb_setPixel(self.fbnum, x, y, color)

def fill(self, color):
"""
Fills the complete framebuffer with one color. Using as color 0x00000000
or rgba(0, 0, 0, 0) is equivalent to clear the framebuffer (fill the
framebuffer with black).
@param color The color value or Color object
"""
color = getColorValue(color)
for i in range(0, self.yres):
fb.pyfb_drawHorizontalLine(0, 0, i, self.xres, color)

def drawLine(self, x1, y1, x2, y2, color):
"""
Draws a line from the Point (x1 | y1) to
Expand Down

0 comments on commit b436da5

Please sign in to comment.