]> git.xonotic.org Git - xonotic/xonstat.git/commit
Cap RGB value darkness by first converting to HSL, then applying threshold.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 18 Mar 2012 20:07:03 +0000 (16:07 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 18 Mar 2012 20:07:03 +0000 (16:07 -0400)
commit8bda3065e1f4ab28e05caf668199a80053a2dcfc
tree24a42688427d44149706f29c72c1c4375ec6026d
parent5755c1000d40639ab451cad5a3f2d7c139214d9d
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