Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _validate_point_set_colors(self, proposal):
value = proposal['value']
n_colors = len(value)
if self.point_sets:
n_colors = len(self.point_sets)
result = np.zeros((n_colors, 3), dtype=np.float32)
for index, color in enumerate(value):
result[index, :] = matplotlib.colors.to_rgb(color)
if len(value) < n_colors:
for index in range(len(value), n_colors):
color = colorcet.glasbey[index % len(colorcet.glasbey)]
result[index, :] = matplotlib.colors.to_rgb(color)
return result