]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
fix typos
authorDavid Mazary <dmazary@gmail.com>
Sun, 18 Mar 2012 18:38:28 +0000 (15:38 -0300)
committerDavid Mazary <dmazary@gmail.com>
Sun, 18 Mar 2012 18:38:28 +0000 (15:38 -0300)
xonstat/util.py

index 0afa65463f812661959c376f7b8bf09eefbe1b5b..57fd54f8d13fb50d1c15db761ce17056c8fa7f48 100755 (executable)
@@ -60,7 +60,7 @@ _dec_colors = re.compile(r'\^(\d)')
 _hex_colors = re.compile(r'\^x([\dA-Fa-f])([\dA-Fa-f])([\dA-Fa-f])')
 
 # On a light scale of 0 (black) to 255 (white)
-_contrash_threshold = 128
+_contrast_threshold = 128
 
 
 def qfont_decode(qstr=''):
@@ -87,10 +87,10 @@ def hex_repl(match):
     g = match.group(2) * 2
     b = match.group(3) * 2
     hue, light, satur = rgb_to_hls(int(r, 16), int(g, 16), int(b, 16))
-    if light < _contrash_threshold:
-        light = _contrash_threshold
+    if light < _contrast_threshold:
+        light = _contrast_threshold
     r, g, b = hls_to_rgb(hue, light, satur)
-    return '<span style="rgb({0},{1},{2})">'.format(r, g, b)
+    return '<span style="color:rgb({0},{1},{2})">'.format(r, g, b)
 
 
 def html_colors(qstr=''):