Lighten background color

This commit is contained in:
Junior 2024-06-05 17:06:25 -04:00
parent 7ec12c0ce5
commit f1dba7705b

View File

@ -20,6 +20,7 @@ float_precision = 1
yellow = (240, 240, 20) yellow = (240, 240, 20)
white = (255, 255, 255) white = (255, 255, 255)
black = (0, 0, 0) black = (0, 0, 0)
background = (80, 80, 80)
button_origin_x = 90 button_origin_x = 90
button_origin_y = 280 button_origin_y = 280
@ -121,7 +122,7 @@ def flash_button(b):
center_x = button_origin_x + (b.column * button_spacing) center_x = button_origin_x + (b.column * button_spacing)
center_y = button_origin_y + (b.row * button_spacing) center_y = button_origin_y + (b.row * button_spacing)
center = (center_x, center_y) center = (center_x, center_y)
pygame.draw.circle(screen, black, center, button_radius, 4) pygame.draw.circle(screen, background, center, button_radius, 4)
pygame.draw.circle(screen, yellow, center, button_radius, 2) pygame.draw.circle(screen, yellow, center, button_radius, 2)
b.flashing = False b.flashing = False
@ -144,6 +145,8 @@ pygame.display.set_caption('CheesyCalc')
icon = pygame.image.load(os.path.join("img", "cheesy_icon_32x32.png")) icon = pygame.image.load(os.path.join("img", "cheesy_icon_32x32.png"))
icon.convert_alpha() icon.convert_alpha()
pygame.display.set_icon(icon) pygame.display.set_icon(icon)
screen.fill(background)
pygame.display.flip()
logo = pygame.image.load(os.path.join("img", "cheesy.png")) logo = pygame.image.load(os.path.join("img", "cheesy.png"))
logo.convert_alpha() logo.convert_alpha()
screen.blit(logo, (30, 20)) screen.blit(logo, (30, 20))
@ -154,6 +157,7 @@ screen.blit(logo_text_1, (width // 2 - logo_text_1.get_width() // 2 + 80, 0))
screen.blit(logo_text_2, (width // 2 - logo_text_2.get_width() // 2 + 80, 45)) screen.blit(logo_text_2, (width // 2 - logo_text_2.get_width() // 2 + 80, 45))
sevenseg_font = pygame.font.Font(os.path.join("font", "DSEG7Modern-Bold.ttf"), 60) sevenseg_font = pygame.font.Font(os.path.join("font", "DSEG7Modern-Bold.ttf"), 60)
draw_buttons() draw_buttons()
pygame.display.flip()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
@ -232,11 +236,12 @@ while True:
print(display_num_decimal) print(display_num_decimal)
old_display_num_whole = display_num_whole old_display_num_whole = display_num_whole
old_display_num_decimal = display_num_decimal old_display_num_decimal = display_num_decimal
pygame.draw.rect(screen, (0, 0, 0), pygame.Rect(12, 97, 576, 126)) #pygame.draw.rect(screen, (0, 0, 0), pygame.Rect(12, 97, 576, 126))
num_show = (num_float == False) pygame.draw.rect(screen, black, pygame.Rect(10, 100, width - 20, 110))
pygame.draw.rect(screen, yellow, pygame.Rect(10, 100, width - 20, 110), 2)
text = sevenseg_font.render(display_num_whole + "." + display_num_decimal, True, white) text = sevenseg_font.render(display_num_whole + "." + display_num_decimal, True, white)
screen.blit(text, (580 - text.get_width(), 120)) screen.blit(text, (width - 20 - text.get_width(), 120))
pygame.draw.rect(screen, yellow, pygame.Rect(10, 100, 580, 110), 2) #pygame.draw.rect(screen, yellow, pygame.Rect(10, 100, 580, 110), 2)
for key, b in buttons.items(): for key, b in buttons.items():
if b.flashing == True and time.time() >= b.unflash_on: if b.flashing == True and time.time() >= b.unflash_on:
flash_button(b) flash_button(b)