diff --git a/ti842py/__version__.py b/ti842py/__version__.py index 3d9770d..32c32f6 100644 --- a/ti842py/__version__.py +++ b/ti842py/__version__.py @@ -1,7 +1,7 @@ __title__ = "ti842py" __description__ = "TI-BASIC to Python 3 Transpiler" __url__ = "https://github.com/TabulateJarl8/ti842py" -__version__ = "0.8.2" +__version__ = "0.8.3" __author__ = "Tabulate" __author_email__ = "tabulatejarl8@gmail.com" __license__ = "GPLv3" diff --git a/ti842py/utils/draw.py b/ti842py/utils/draw.py index 966e8cf..9d2219e 100644 --- a/ti842py/utils/draw.py +++ b/ti842py/utils/draw.py @@ -2,6 +2,7 @@ import time import tkinter.font as tkfont import decimal +import re BLUE = 10 @@ -64,8 +65,9 @@ def tiColorToGraphicsColor(self, color, isBackground=False): color = str(color) for color1, color2 in self.colors.items(): color = color.replace(color1, color2) - for color1, color2 in self.colorNumbers.items(): - color = color.replace(color1, color2) + color = re.sub(r'(\d+)', lambda m: self.colorNumbers.get(m.group(), '[ERR:DOMAIN]'), color) + if '[ERR:DOMAIN]' in color: + raise ValueError('The specified color value was not in range 10-24') if color not in self.colors.values(): # Failsafe if not isBackground: diff --git a/ti842py/utils/getKey.py b/ti842py/utils/getKey.py index ce90897..99bd622 100644 --- a/ti842py/utils/getKey.py +++ b/ti842py/utils/getKey.py @@ -73,9 +73,7 @@ def __init__(self): " ": 102, ".": 103, ":": 103, - "-": 104, "?": 104, - "−": 104, pynput.keyboard.Key.enter: 105 }