def set_outline(self, color=[255, 0, 0], width=2):
'enables the draw_outline and sets line color and width'
self.perm_outline = True
if color == 0 and hasattr(self, "door_outline") is False: # if color is 0 calculate colour from base colour
# convert to hsv
c = self.color
h, s, v = ex.rgb_to_hsv(c[0], c[1], c[2])
outline_color = ex.hsv_to_rgb(h, s + 50, v - 50)
self.perm_outline_color = outline_color
elif color == 1:
c = self.color
h, s, v = ex.rgb_to_hsv(c[0], c[1], c[2])
outline_color = ex.hsv_to_rgb(h, s + 20, v - 20)
self.perm_outline_color = outline_color
elif hasattr(self, "door_outline") is False:
self.perm_outline_color = color
else:
pass
# self.perm_outline_color = color
# self.perm_outline_color = [255,0,0]
self.perm_outline_width = width
self.init_pow = width
评论列表
文章目录