def hue_map(self, value):
'''
:param value: number 0 to 1, map to hue 0.6 - 0 (blue to red, like heatmap)
more highter the value, more warm the color
:return: hex of rgb
'''
HUE_MAX = 0.6
hue = pow(1 - value, 2) * HUE_MAX
rgb = colors.hsv_to_rgb((hue, 1, 1))
hex = colors.to_hex(rgb)
return hex
评论列表
文章目录