From 06dba8c0093504a5c352963aaa4a730c09e966ac Mon Sep 17 00:00:00 2001 From: thirdr Date: Thu, 4 Apr 2024 16:16:28 +0100 Subject: [PATCH] fixed background colour --- .../examples/tufty2040/display_png_offset_palette.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/micropython/examples/tufty2040/display_png_offset_palette.py b/micropython/examples/tufty2040/display_png_offset_palette.py index f1e402dd..d69e94a3 100644 --- a/micropython/examples/tufty2040/display_png_offset_palette.py +++ b/micropython/examples/tufty2040/display_png_offset_palette.py @@ -11,7 +11,7 @@ BG = display.create_pen(200, 200, 200) TEXT = display.create_pen(0, 0, 0) # 16 Reds -for i in range(16): +for i in range(15): display.create_pen(i * 16, 0, 0) # 16 Greens @@ -19,9 +19,13 @@ for i in range(16): display.create_pen(0, i * 16, 0) # 16 Blues -for i in range(16): +for i in range(15): display.create_pen(0, 0, i * 16) +# Adding in an white background colour at the beginning of each offset. +for i in range(3): + display.update_pen(i * 16, 200, 200, 200) + # Clear the screen display.set_pen(BG) display.clear()