]> git.ipfire.org Git - oddments/collecty.git/commitdiff
colours: Fix string formatting for transparency
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 20 Sep 2020 13:11:51 +0000 (13:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 20 Sep 2020 13:11:51 +0000 (13:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/colours.py

index 8d880a135f923c3fdd8dd04515ce93d50790ab6d..f0eb7daeabb2f633d1ef8ce06879a5ee16230abd 100644 (file)
@@ -61,7 +61,7 @@ def transparency(colour, scale=0.1):
        """
                Adds transparency to the given colour code
        """
-       return "%s%02X" % (colour, 0xff * scale)
+       return "%s%02X" % (colour, round(0xff * scale))
 
 BLACK        = "#000000"
 WHITE        = "#FFFFFF"