From: David Mazary <dmazary@gmail.com>
Date: Sun, 18 Mar 2012 19:40:18 +0000 (-0300)
Subject: round and int rgb css color values
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=91eb812f1181c9fc50cf0abc31e01f42f76d3b04;p=xonotic%2Fxonstat.git

round and int rgb css color values
---

diff --git a/xonstat/util.py b/xonstat/util.py
index e34adfc..de5153a 100755
--- a/xonstat/util.py
+++ b/xonstat/util.py
@@ -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)