Skip to content

Commit

Permalink
Merge pull request #15 from rapgro/master
Browse files Browse the repository at this point in the history
python3: hexadecimal string formatter needs integer instead of float
  • Loading branch information
Tom Striker committed Aug 4, 2016
2 parents 3e87371 + dc4eb69 commit 722c52e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apx/lib/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def gdk(self, color):

def hex(self, color):
c = self.parse(color)
return "#" + "".join(["%02x" % (color * 255) for color in c])
return "#" + "".join(["%02x" % int(color * 255) for color in c])

def is_light(self, color):
"""tells you if color is dark or light, so you can up or down the
Expand Down
2 changes: 1 addition & 1 deletion apx/lib/pytweener.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def datetime_update(fraction):

def color_update(fraction):
val = [max(min(self.start_value[i] + self.change[i] * fraction, 255), 0) for i in range(3)]
return "#%02x%02x%02x" % (val[0], val[1], val[2])
return "#" + "".join(["%02x" % int(v) for v in val])


if isinstance(start_value, int) or isinstance(start_value, float):
Expand Down

0 comments on commit 722c52e

Please sign in to comment.