From 8bda3065e1f4ab28e05caf668199a80053a2dcfc Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sun, 18 Mar 2012 16:07:03 -0400 Subject: [PATCH] Cap RGB value darkness by first converting to HSL, then applying threshold. RGB values that were too dark to read against a black background are now viewable. This is done by converting the RGB values (from the hex values provided) to HSL, then moving any L (lightness) values beyond a certain threshold back. Finally they are converted back to RGB for display. In practice all this really does is to lighten the dark colors without changing their hue or saturation values (e.g. black becomes gray). Thanks go to dmazary for helping me with this and working through the various bugs I found. Thanks, Dave! --- xonstat/util.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xonstat/util.py b/xonstat/util.py index de5153a..1db7770 100755 --- a/xonstat/util.py +++ b/xonstat/util.py @@ -42,16 +42,16 @@ _qfont_table = [ # Hex-colored spans for decimal color codes ^0 - ^9 _dec_spans = [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" ] # Color code patterns -- 2.39.2