-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadtheme.py
31 lines (23 loc) · 1.23 KB
/
loadtheme.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
31
import os
import configparser
import wx
class themeClass():
def __init__(self, theme):
def parseColor(array):
if (array != "N/A"):
array = array.split(", ")
numArray = []
for x in array:
numArray.append(int(x))
return wx.Colour(numArray[0], numArray[1], numArray[2])
file = "themes/"+theme+".theme"
themeFile = configparser.ConfigParser()
themeFile.read(file)
self.FOREGROUND = parseColor(themeFile.get("THEME", "FOREGROUND", fallback="N/A"))
self.BACKGROUND = parseColor(themeFile.get("THEME", "BACKGROUND", fallback="N/A"))
self.BACKGROUND2 = parseColor(themeFile.get("THEME", "BACKGROUND2", fallback="N/A"))
self.BUTTON = parseColor(themeFile.get("THEME", "BUTTON", fallback="N/A"))
self.I_CREATEEYE = themeFile.get("THEME", "I_CREATEEYE", fallback="assets/createEye.png")
self.I_DELETEEYE = themeFile.get("THEME", "I_DELETEEYE", fallback="assets/deleteEye.png")
self.I_EDITEYE = themeFile.get("THEME", "I_EDITEYE", fallback="assets/editEye.png")
self.I_UNKNOWN = themeFile.get("THEME", "I_UNKNOWN", fallback="assets/Unknown/")