forked from AlejoG10/python-chess-ai-yt
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
30 lines (24 loc) · 1.09 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pygame
import os
from constants import *
from sound import Sound
from theme import Theme
class Config:
def __init__(self):
self.themes = []
self._add_themes()
self.idx = 0
self.theme = self.themes[self.idx]
self.font = pygame.font.SysFont('monospace', 18, bold=True)
self.move_sound = Sound(os.path.join(f'{SOUNDS_PATH}/move.wav'))
self.capture_sound = Sound(os.path.join(f'{SOUNDS_PATH}/capture.wav'))
def change_theme(self):
self.idx += 1
self.idx %= len(self.themes)
self.theme = self.themes[self.idx]
def _add_themes(self):
green = Theme((234, 235, 200), (119, 154, 88), (244, 247, 116), (172, 195, 51), '#C86464', '#C84646')
brown = Theme((235, 209, 166), (165, 117, 80), (245, 234, 100), (209, 185, 59), '#C86464', '#C84646')
blue = Theme((229, 228, 200), (60, 95, 135), (123, 187, 227), (43, 119, 191), '#C86464', '#C84646')
grey = Theme((120, 119, 118), (86, 85, 84), (99, 126, 143), (82, 102, 128), '#C86464', '#C84646')
self.themes = [green, brown, blue, grey]