fix coloring

This commit is contained in:
2026-06-25 22:42:49 -04:00
parent 6ba3b878db
commit 714e738ef5
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -81,10 +81,13 @@ def _render_game_to_pil(img, game, x_offset):
away_logo = logos.load_logo(league, game["away"]) away_logo = logos.load_logo(league, game["away"])
home_logo = logos.load_logo(league, game["home"]) home_logo = logos.load_logo(league, game["home"])
if away_logo: if away_logo:
# logos.load_logo returns an RGB PIL image — paste directly r, g, b = away_logo.split()
img.paste(away_logo.resize((14, 14)), (x_offset, 0)) bgr_logo = Image.merge("RGB", (b, g, r))
img.paste(bgr_logo.resize((14, 14)), (x_offset, 0))
if home_logo: if home_logo:
img.paste(home_logo.resize((14, 14)), (x_offset, 16)) r, g, b = home_logo.split()
bgr_logo = Image.merge("RGB", (b, g, r))
img.paste(bgr_logo.resize((14, 14)), (x_offset, 16))
# divider on right edge (except last slot handled by wrapping) # divider on right edge (except last slot handled by wrapping)
for row in range(PANEL_HEIGHT): for row in range(PANEL_HEIGHT):
+1 -1
View File
@@ -32,4 +32,4 @@ def draw_logo(canvas, img, x, y):
for py in range(img.height): for py in range(img.height):
# FIX: unpack as RGB (load_logo guarantees RGB now) # FIX: unpack as RGB (load_logo guarantees RGB now)
r, g, b = img.getpixel((px, py)) r, g, b = img.getpixel((px, py))
canvas.SetPixel(x + px, y + py, b, g, r) # bgr panels canvas.SetPixel(x + px, y + py, b, r, g) # bgr panels