Download:
child 74:d016e96c0182
parent 72:121a21cb606e
73:0ff094b4fb4a
Anton Shestakov <av6@dwimlabs.net>, Thu, 04 Aug 2016 10:54:57 +0800
viewer: if we want to maybe support Python 3, do the PEP 3113 thing

1 файлов изменено, 2 вставок(+), 1 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Mon Aug 01 10:53:12 2016 +0800
+++ b/viewer.py Thu Aug 04 10:54:57 2016 +0800
@@ -300,7 +300,8 @@
self.render('fancy.html', **context)
-def green_to_red((low, high), value):
+def green_to_red(limits, value):
+ low, high = limits
hue = (value - low) / (high - low) if high != low else 0.5
r, g, b = colorsys.hsv_to_rgb((1 - hue) * 0.3, 1, 1)
return (int(r * 255), int(g * 255), int(b * 255))