Skip to content

Commit

Permalink
Version 0.2.5: added colors_fade_with_distance
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Nov 9, 2017
1 parent c9243b0 commit 818e244
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jyro/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.4'
__version__ = '0.2.5'
6 changes: 5 additions & 1 deletion jyro/simulator/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def __init__(self, width=60, height=40, field=120):
self.startAngle = (self.field * PIOVER180)/2
self.ground_color = colorMap["backgroundgreen"]
self.sky_color = colorMap["lightblue"]
self.colors_fade_with_distance = True

def draw(self, robot, canvas):
bx = [ .14, .06, .06, .14] # front camera
Expand Down Expand Up @@ -519,7 +520,10 @@ def getImage(self):
ccode = colorMap[ccode]
elif isinstance(ccode, int):
ccode = colorMap[colorNames[ccode]]
color = tuple([int(v * dist) for v in tuple(ccode)])
if self.colors_fade_with_distance:
color = tuple([int(v * dist) for v in tuple(ccode)])
else:
color = tuple([int(v) for v in tuple(ccode)])
draw.line([(w, y1), (w, y2)], fill=color, width=1)
elif shape[0] == "light":
stype, d, diff, x = shape
Expand Down

0 comments on commit 818e244

Please sign in to comment.