def get_formatted(self, list_colors):
formatted = []
for c in list_colors:
if isinstance(c, np.ndarray):
c = rgb2hex(c)
if c[0] == "#":
formatted.append(c)
elif c in self.color_map:
formatted.append(self.color_map[c])
elif c in self.aliases:
alias = self.aliases[c]
formatted.append(self.color_map[alias])
else:
raise ValueError("Color %s is not mapped. Please give a hex code" % c)
return formatted
评论列表
文章目录