From 3e41a2987c91d1b1994fe069177f2ad75c5654d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 21 Dec 2017 19:12:55 +0100 Subject: [PATCH] imgconverter: fix make_padlock function hex_to_float is gone, use hex_to_int instead Fixes QubesOS/qubes-issues#3331 --- imgconverter/qubesimgconverter/imggen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imgconverter/qubesimgconverter/imggen.py b/imgconverter/qubesimgconverter/imggen.py index 0d329ca..fef07b0 100644 --- a/imgconverter/qubesimgconverter/imggen.py +++ b/imgconverter/qubesimgconverter/imggen.py @@ -38,7 +38,8 @@ def make_padlock(dst, colour, size=qubesimgconverter.ICON_MAXSIZE, disp=False): cs = cairo.ImageSurface(cairo.FORMAT_ARGB32, size, size) cr = cairo.Context(cs) - cr.set_source_rgb(*qubesimgconverter.hex_to_float(colour)) + cr.set_source_rgb(*[c / 256.0 + for c in qubesimgconverter.hex_to_int(colour)]) cr.set_line_width(.125 * size) cr.rectangle(.125 * size, .5 * size, .75 * size, .4375 * size) @@ -76,7 +77,7 @@ def make_padlock(dst, colour, size=qubesimgconverter.ICON_MAXSIZE, disp=False): cr.arc_negative(cx, cy, radius + width, offset + (i + 1) * arrow - gap, offset + i * arrow) cr.close_path() - cr.set_source_rgb(*qubesimgconverter.hex_to_float('0xcc0000')) # tango's red + cr.set_source_rgb(0xcc / 256.0, 0, 0) # tango's red cr.set_line_width(.0500 * size) cr.set_line_join(cairo.LINE_JOIN_ROUND) cr.stroke_preserve()