Skip to content

Commit d561e34

Browse files
committed
test
1 parent d0aadcd commit d561e34

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

‎tests/pl/test_utils.py‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,16 @@ def test_extract_scalar_value():
109109
assert _extract_scalar_value([], default=1.0) == 1.0
110110

111111

112-
def test_plot_can_handle_per_row_rgba_colors(sdata_blobs: SpatialData):
113-
"""Test handling of per-row RGBA color arrays."""
112+
def test_plot_can_handle_rgba_color_specifications(sdata_blobs: SpatialData):
113+
"""Test handling of RGBA color specifications."""
114+
# Test with RGBA tuple
115+
sdata_blobs.pl.render_shapes(element="blobs_circles", color=(1.0, 0.0, 0.0, 0.8)).pl.show()
114116

115-
rgba_colors = np.array(
116-
[
117-
[1.0, 0.0, 0.0, 1.0], # red
118-
[0.0, 1.0, 0.0, 1.0], # green
119-
[0.0, 0.0, 1.0, 1.0], # blue
120-
[1.0, 1.0, 0.0, 1.0], # yellow
121-
[1.0, 0.0, 1.0, 1.0], # magenta
122-
]
123-
)
124-
sdata_blobs.shapes["blobs_circles"]["rgba_colors"] = rgba_colors.tolist()
117+
# Test with RGB tuple (no alpha)
118+
sdata_blobs.pl.render_shapes(element="blobs_circles", color=(0.0, 1.0, 0.0)).pl.show()
125119

126-
sdata_blobs.pl.render_shapes(element="blobs_circles", color="rgba_colors").pl.show()
120+
# Test with string color
121+
sdata_blobs.pl.render_shapes(element="blobs_circles", color="blue").pl.show()
127122

128123

129124
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)