From 8bf35b799157e0b899ec2b634a463886fac62220 Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Mon, 1 Apr 2024 16:31:28 -0400 Subject: [PATCH] fix fill alpha ignoring alpha from colormaps --- .gitignore | 1 + src/spatialdata_plot/pl/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 84ad50c4..5eff8aa4 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ tests/figures/ # other _version.py +/temp/ diff --git a/src/spatialdata_plot/pl/utils.py b/src/spatialdata_plot/pl/utils.py index 62d7f2d5..caeb4c00 100644 --- a/src/spatialdata_plot/pl/utils.py +++ b/src/spatialdata_plot/pl/utils.py @@ -221,7 +221,7 @@ def _get_collection_shape( c = cmap(norm(c)) fill_c = ColorConverter().to_rgba_array(c) - fill_c[..., -1] = render_params.fill_alpha + fill_c[..., -1] *= render_params.fill_alpha if render_params.outline_params.outline: outline_c = ColorConverter().to_rgba_array(render_params.outline_params.outline_color)