Skip to content

Can't specify single color for render_label by a color string #470

Description

@ziyuanzhao2000

Please see the simple MWE:

import spatialdata as sd
from spatialdata.models import Labels2DModel
sdata_test = sd.SpatialData()
labels = np.ones((10, 10), dtype=np.uint8)
sdata_test['labels'] = Labels2DModel.parse(labels)
sdata_test.pl.render_labels('labels', color='green').pl.show()

However, I cannot specify the label mask to be rendered in green...

This is what I get
Image

Activity

  1. changed the title [-]Can't specify single color for render_label by a color string[/-] [+]Can't specify single color for `render_label` by a color string[/+] on Jun 3, 2025
  2. timtreis commented on Oct 30, 2025

    @timtreis
    Member

    We're currently working on homogenising the color handling in #497, but in the meantime you can just substitute color for na_color and it'll work

  3. added 5 commits that reference this issue on Feb 27, 2026
    663d40b
    3542f6b
    6338980
    c31d2e9
    4958f84
  4. timtreis commented on Mar 19, 2026

    @timtreis
    Member

    Should be closed in main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglabels 🏷️Anything related to Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions