From df368c515abac0855b0a38008256787bbc2989e0 Mon Sep 17 00:00:00 2001 From: David Mazary Date: Sun, 18 Mar 2012 16:22:29 -0300 Subject: [PATCH] normalize from 255 to 1 correctly :) --- xonstat/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xonstat/util.py b/xonstat/util.py index e88c6b3..2b1582d 100755 --- a/xonstat/util.py +++ b/xonstat/util.py @@ -84,9 +84,9 @@ def strip_colors(qstr=''): def hex_repl(match): # Convert hex to 8 bits and to 0.0-1.0 scale - r = 255. / int(match.group(1) * 2, 16) - g = 255. / int(match.group(2) * 2, 16) - b = 255. / int(match.group(3) * 2, 16) + r = int(match.group(1) * 2, 16) / 255. + g = int(match.group(2) * 2, 16) / 255. + b = int(match.group(3) * 2, 16) / 255. hue, light, satur = rgb_to_hls(r, g, b) if light < _contrast_threshold: light = _contrast_threshold -- 2.39.2