def getUserAgentColor(subver):
'''
userAgent = subver.lower()
if "classic" in userAgent:
color = COLOR_GOLD
elif "unlimited" in userAgent:
color = COLOR_LTBLUE
elif "xt" in userAgent:
color = COLOR_GREEN
elif "satoshi" not in userAgent:
color = COLOR_RED
else:
color = COLOR_WHITE
return color
'''
hash = hashlib.sha256(subver).hexdigest()
return curses.color_pair((int(hash[10:20], 16) % 7) + 1)
# turn any arbitrary string into a (r, g, b) color via hash
评论列表
文章目录