Skip to content

Commit

Permalink
fix drawing colors
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed Jul 21, 2021
1 parent 8b984ac commit b5b7274
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ti842py/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__title__ = "ti842py"
__description__ = "TI-BASIC to Python 3 Transpiler"
__url__ = "https://github.com/TabulateJarl8/ti842py"
__version__ = "0.9.2"
__version__ = "0.9.3"
__author__ = "Tabulate"
__author_email__ = "[email protected]"
__license__ = "GPLv3"
Expand Down
10 changes: 5 additions & 5 deletions ti842py/utils/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def graphCoordsToPixels(self, x, y, minX=-10, maxX=10, minY=-10, maxY=10):
return horiz, vertical

def tiColorToGraphicsColor(self, color, isBackground=False):
if color not in range(1, 25):
if int(color) not in range(1, 25):
raise InvalidColorError(f'The specified color value "{color}" is not in range 1-24')
color = str(color)

Expand All @@ -86,14 +86,14 @@ def clrDraw(self):
self.win.update()

@_slow
def circle(self, x, y, r, color='blue', linestyle=''):
def circle(self, x, y, r, color=10, linestyle=''):
# TODO: Implement linestyle
c = Circle(Point(self.graphCoordsToPixels(x), self.graphCoordsToPixels(y)), r)
c.setOutline(self.tiColorToGraphicsColor(color))
c.draw(self.win)

@_slow
def line(self, x1, y1, x2, y2, erase=1, color='blue', style=1):
def line(self, x1, y1, x2, y2, erase=1, color=10, style=1):
# TODO: Erase and style not implemented yet
x1, y1 = self.graphCoordsToPixels(x1, y1)
x2, y2 = self.graphCoordsToPixels(x2, y2)
Expand Down Expand Up @@ -134,7 +134,7 @@ def text(self, row, column, *args):
self.texts[str(column)][str(row)] = message

@_slow
def pxlOn(self, row, column, color='blue'):
def pxlOn(self, row, column, color=10):
# Row = y; Column = x
pnt = Point(column, row)
pnt.setOutline(self.tiColorToGraphicsColor(color))
Expand All @@ -158,7 +158,7 @@ def pxlTest(self, row, column):
return False

@_slow
def ptOn(self, x, y, mark=1, color='blue'):
def ptOn(self, x, y, mark=1, color=10):
x, y = self.graphCoordsToPixels(x, y)

if str(x) not in self.points:
Expand Down

0 comments on commit b5b7274

Please sign in to comment.