From 3af3fdacefdca6abef7ed68e91ea100208c77a96 Mon Sep 17 00:00:00 2001 From: Jan Behrens Date: Tue, 23 Apr 2013 09:40:37 +0200 Subject: [PATCH] Fix bug in player badges: win% color computed wrong --- xonstat/batch/badges/skin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 982512e..f18370f 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -413,16 +413,16 @@ class Skin: try: txt = "%.2f%%" % round(win_pct, 2) except: - win_pct = 0 + win_pct = 0. if self.winp_pos: - if win_pct >= 0.5: - nr = 2*(win_pct-0.5) + if win_pct >= 50.0: + nr = 2*(win_pct/100-0.5) r = nr*self.winp_colortop[0] + (1-nr)*self.winp_colormid[0] g = nr*self.winp_colortop[1] + (1-nr)*self.winp_colormid[1] b = nr*self.winp_colortop[2] + (1-nr)*self.winp_colormid[2] else: - nr = 2*win_pct + nr = 2*(win_pct/100) r = nr*self.winp_colormid[0] + (1-nr)*self.winp_colorbot[0] g = nr*self.winp_colormid[1] + (1-nr)*self.winp_colorbot[1] b = nr*self.winp_colormid[2] + (1-nr)*self.winp_colorbot[2] -- 2.39.2