Skip to content

Commit f53b4b2

Browse files
authored
Update grid_layout.py
Added the ability to change the divider line color
1 parent d5aa61d commit f53b4b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adafruit_displayio_layout/layouts/grid_layout.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(
5959
divider_lines=False,
6060
h_divider_line_rows=None,
6161
v_divider_line_cols=None,
62+
divider_line_color=0xFFFFFF,
6263
):
6364
super().__init__(x=x, y=y)
6465
self.x = x
@@ -70,6 +71,7 @@ def __init__(
7071
self._cell_content_list = []
7172

7273
self._divider_lines = []
74+
self._divider_color = divider_line_color
7375
self.h_divider_line_rows = h_divider_line_rows
7476
self.v_divider_line_cols = v_divider_line_cols
7577

@@ -164,8 +166,8 @@ def _layout_cells(self):
164166

165167
if self._divider_lines_enabled:
166168
palette = displayio.Palette(2)
167-
palette[0] = 0xFFFFFF
168-
palette[1] = 0xFFFFFF
169+
palette[0] = self._divider_color
170+
palette[1] = self._divider_color
169171

170172
if not hasattr(cell["content"], "anchor_point"):
171173
_bottom_line_loc_y = (

0 commit comments

Comments
 (0)