aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/main.py b/main.py
index 16697d6..d3a0b34 100644
--- a/main.py
+++ b/main.py
@@ -40,23 +40,13 @@ class Command(QtCore.QObject):
# colour settings
RGBError = 'Bad RGB input (use two commas)'
# load colors as tuples from a comma-separated string
- self.textColor = tuple([int(i) for i in self.settings.value("textColor", '255, 255, 255').split(',')])
- self.visColor = tuple([int(i) for i in self.settings.value("visColor", '255, 255, 255').split(',')])
+ self.textColor = core.Core.RGBFromString(self.settings.value("textColor", '255, 255, 255'))
+ self.visColor = core.Core.RGBFromString(self.settings.value("visColor", '255, 255, 255'))
if self.args.textcolor:
- try:
- r, g, b = self.args.textcolor.split(',')
- except:
- print(RGBError)
- else:
- self.textColor = (int(r), int(g), int(b))
+ self.textColor = core.Core.RGBFromString(self.args.textcolor)
if self.args.viscolor:
- try:
- r, g, b = self.args.viscolor.split(',')
- except:
- print(RGBError)
- else:
- self.visColor = (int(r), int(g), int(b))
-
+ self.visColor = core.Core.RGBFromString(self.args.viscolor)
+
# font settings
if self.args.font:
self.font = QFont(self.args.font)