Skip to content

Fix unlabel_rgb raising on a list of colors - #5777

Open
vineoy wants to merge 1 commit into
plotly:mainfrom
vineoy:unlabel-rgb-list-3054
Open

vineoy wants to merge 1 commit into
plotly:mainfrom
vineoy:unlabel-rgb-list-3054

Conversation

@vineoy

@vineoy vineoy commented Sep 27, 2026

Copy link
Copy Markdown

Link to issue

Fixes #3054.

Description of change

The \unlabel_rgb\ docstring states it takes either a single 'rgb(a, b, c)'\ color or a list of such colors, but passing a list crashed with \ValueError: could not convert string to float: ''\ because the character-by-character parser ran over the list itself.

The function now maps over lists/tuples elementwise, so \unlabel_rgb(sequential.YlOrRd)\ returns a list of (r, g, b)\ tuples as documented. Single-string behavior is unchanged (all existing callers pass single strings).

Testing strategy

  • New regression test \ est_unlabel_rgb_parses_list\ (including the empty-list edge) alongside the existing test: add unit tests for rgb/hex color conversion helpers #5659 color-helper tests.
  • \CHANGELOG.md\ entry added under Unreleased/Fixed.
  • Local runs: all 19 tests in \ ests/test_plotly_utils/colors/\ pass; pinned
    uff==0.11.12 check\ clean; verified the exact repro from the issue.

@camdecoster

Copy link
Copy Markdown
Contributor

Thanks for the PR! We'll review this and follow up.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unlabel_rgb does not work on a list as it says in the docs

3 participants