diff options
Diffstat (limited to 'src/gui/tasks/duration.py')
-rw-r--r-- | src/gui/tasks/duration.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/tasks/duration.py b/src/gui/tasks/duration.py index e863914..3ce8203 100644 --- a/src/gui/tasks/duration.py +++ b/src/gui/tasks/duration.py @@ -1,6 +1,9 @@ -import re +from PyQt5 import QtGui from typing import Optional import math +import re + +import gui.color def format(minutes: int): if minutes >= 60 * 24: @@ -37,3 +40,11 @@ def parse(duration: str) -> Optional[int]: return None else: return 0 + +def color(minutes: int): + if minutes <= 15: + return gui.color.short_duration + elif minutes < 60: + return gui.color.medium_duration + else: + return gui.color.long_duration |