We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bd4b78 commit ffd4a1fCopy full SHA for ffd4a1f
src/spatialdata_plot/pl/utils.py
@@ -877,7 +877,14 @@ def _generate_base_categorial_color_mapping(
877
if "#" not in na_color:
878
# should be unreachable, but just for safety
879
raise ValueError("Expected `na_color` to be a hex color, but got a non-hex color.")
880
- return dict(zip(categories, colors + [na_color]))
+
881
+ colors = [to_hex(to_rgba(color)[:3]) for color in colors]
882
+ na_color = to_hex(to_rgba(na_color)[:3])
883
884
+ if na_color and len(categories) > len(colors):
885
+ return dict(zip(categories, colors + [na_color]))
886
887
+ return dict(zip(categories, colors))
888
889
return _get_default_categorial_color_mapping(color_source_vector)
890
0 commit comments