]> git.xonotic.org Git - xonotic/xonstat.git/commitdiff
round and int rgb css color values
authorDavid Mazary <dmazary@gmail.com>
Sun, 18 Mar 2012 19:40:18 +0000 (16:40 -0300)
committerDavid Mazary <dmazary@gmail.com>
Sun, 18 Mar 2012 19:40:18 +0000 (16:40 -0300)
xonstat/util.py

index e34adfc2aa5268460a802c819677edd16d739178..de5153a485069860eb070d09efe022fad6f9e56b 100755 (executable)
@@ -91,7 +91,7 @@ def hex_repl(match):
     if light < _contrast_threshold:
         light = _contrast_threshold
     # Get new rgb in 0-255 scale
-    r, g, b = tuple([255 * i for i in hls_to_rgb(hue, light, satur)])
+    r, g, b = tuple([int(round(255 * i)) for i in hls_to_rgb(hue, light, satur)])
     return '<span style="color:rgb({0},{1},{2})">'.format(r, g, b)