From 2f05b8339053a3a965b5e6777d611f778a4fc0d6 Mon Sep 17 00:00:00 2001 From: Krateng Date: Mon, 24 Jun 2019 12:15:56 +0200 Subject: [PATCH] Added sanity check to compare --- website/compare.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/compare.py b/website/compare.py index 338ddd2..febbe64 100644 --- a/website/compare.py +++ b/website/compare.py @@ -64,10 +64,14 @@ def instructions(keys): fullmatch = percentages["common"] partialmatch = percentages["more_self"] + percentages["more_other"] + match = fullmatch + (partialmatch)/2 pixel_fullmatch = fullmatch * 2.5 pixel_partialmatch = (fullmatch+partialmatch) * 2.5 + match = min(match,100) + + matchcolor = format(int(min(1,match/50)*255),"02x") * 2 + format(int(max(0,match/50-1)*255),"02x")