1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added sanity check to compare

This commit is contained in:
Krateng 2019-06-24 12:15:56 +02:00
parent a59381d0bf
commit 2f05b83390

View File

@ -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")