Skip to content

Wouldn't it be handy to extract figure colors directly from the napari theme? #236

Description

@Chris-N-K

Thanks for your work :)

What would you think about using the colours provided by the napari theme itself instead of a static style sheet?
Dynamically pulling the colours for the figure parts from the current napari viewer theme, would add support for every style sheet an user could generates for napari.

A possible way to do this would be to extract the theme dict from the viewer: napari.utils.theme.get_theme(napari.current_viewer.theme, as_dict=True) and map the colours of interest to the corresponding rcParams keys. Afterwards, instead of providing a path to with matplotlib.style.context you could provide the dict with the rcParams keys and the color codes.

If you think this might be a good idea I would be happy to give it a try and make a pull-request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New featureNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions