I'm really new to Python and I have a display for my Pi 4 which uses Pygame for the display. I have a box with centred text and I'd like if possible to have the inside background of the box to be a different colour if possible I'd like the background of the box to be RGB (141,180,235) The main display is BACKGROUND_COLOR = pg.Color(42,117,198) which is what the inside of this box is.
Is this possible?
box = pg.Rect(645, 75, 180, 30)
pg.draw.rect(screen, (255,255,255,), box , 1) # draw windspeed box
if skyData.status == sky.STATUS_OK:
ren = font.render("Wind Direction {}°".format(forecastData.angle), 1, pg.Color('black'), pg.Color(134,174,230))
else:
ren = font.render("", 1, pg.Color('black'), pg.Color(185,208,240))
ren_rect = ren.get_rect(center = box.center)
screen.blit(ren, ren_rect)
pg.draw.line(screen, pg.Color('black'), (644, 74), (825, 74)) #shade box
pg.draw.line(screen, pg.Color('black'), (644, 74), (644, 104)) #shade box
This is a BOX with CENTERED TEXT so just changing the background colour of the text will not work
This is what happens if only this is one - colour different to show the change