Blob Blame History Raw
From dc4eb6963243162a8452b878e52c516e75f1292a Mon Sep 17 00:00:00 2001
From: Raphael Groner <raphgro@fedoraproject.org>
Date: Sun, 31 Jul 2016 12:35:07 +0200
Subject: [PATCH] python3: hexadecimal string formatter needs integer instead
 of float

---
 apx/lib/graphics.py  | 2 +-
 apx/lib/pytweener.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/apx/lib/graphics.py b/apx/lib/graphics.py
index c48b865..eecca45 100644
--- a/apx/lib/graphics.py
+++ b/apx/lib/graphics.py
@@ -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
diff --git a/apx/lib/pytweener.py b/apx/lib/pytweener.py
index 6cb2334..21765d8 100644
--- a/apx/lib/pytweener.py
+++ b/apx/lib/pytweener.py
@@ -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):