diff --git a/config.yaml b/config.yaml index f0ad2d1..b5397c4 100644 --- a/config.yaml +++ b/config.yaml @@ -1,10 +1,15 @@ -# window properties window: width: 800 height: 600 icon: "img/tetris_icon.png" title: "Tetris" - background-color: "#6495ED" # cornflower blue engine: - fps: 60 \ No newline at end of file + fps: 60 + +# https://coolors.co/6495ed-ee6352-59cd90-fac05e-f79d84 +color: + cornflower-blue: "#6495ED" + fire-opal: "#EE6352" + emerald: "#59CD90" + maximum-yellow-red: "#59CD90" diff --git a/main.py b/main.py index 4ddf732..cdc238b 100644 --- a/main.py +++ b/main.py @@ -5,11 +5,11 @@ from util.ConfigurationManager import ConfigurationManager # potential color palette https://coolors.co/6495ed-ee6352-59cd90-fac05e-f79d84 FIRE_OPAL = (238, 99, 82) # TODO define colors in config -TILE_SIZE = 20 # TODO define tile size in config +TILE_SIZE = 10 # TODO define tile size in config def draw(screen): # draw window bg - bg_color = pygame.Color(ConfigurationManager.configuration["window"]["background-color"]) + bg_color = pygame.Color(ConfigurationManager.configuration["color"]["cornflower-blue"]) screen.fill(bg_color) # TODO move piece logic into class @@ -26,7 +26,8 @@ def draw(screen): for point in j_scaled_points: j_transalation_points.append((point[0] + TILE_SIZE, point[1] + TILE_SIZE)) - pygame.draw.polygon(screen, FIRE_OPAL, j_transalation_points, 0) + fire_opal = pygame.Color(ConfigurationManager.configuration["color"]["fire-opal"]) + pygame.draw.polygon(screen, fire_opal, j_transalation_points, 0) # update display pygame.display.update()