Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Fix concurrent first access to lazily initialized graph object properties, which could raise `ValueError("Invalid value")` [[#3441](https://github.com/plotly/plotly.py/issues/3441)], with thanks to @hb1915 for the contribution!
- Fix `px.sunburst`, `px.treemap` and `px.icicle` listing sectors in a different order on every run when `path` is used with a Polars DataFrame; sectors now follow their order of first appearance for all dataframe backends [[#5765](https://github.com/plotly/plotly.py/issues/5765)], with thanks to @Irahan2 for the contribution!
- Fix `unlabel_rgb` raising `ValueError` on a list of colors even though the documentation states it accepts one; it now returns a list of tuples [[#3054](https://github.com/plotly/plotly.py/issues/3054)]


## [7.1.0] - 2026-09-15
Expand Down
2 changes: 2 additions & 0 deletions _plotly_utils/colors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ def unlabel_rgb(colors):
This function takes either an 'rgb(a, b, c)' color or a list of
such colors and returns the color tuples in tuple(s) (a, b, c)
"""
if isinstance(colors, (list, tuple)):
return [unlabel_rgb(color) for color in colors]
str_vals = ""
for index in range(len(colors)):
try:
Expand Down
9 changes: 9 additions & 0 deletions tests/test_plotly_utils/colors/test_color_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ def test_unlabel_rgb_parses_string():
assert unlabel_rgb("rgb(1, 2, 3)") == (1.0, 2.0, 3.0)


def test_unlabel_rgb_parses_list():
# https://github.com/plotly/plotly.py/issues/3054
assert unlabel_rgb(["rgb(255, 0, 0)", "rgb(1, 2, 3)"]) == [
(255.0, 0.0, 0.0),
(1.0, 2.0, 3.0),
]
assert unlabel_rgb([]) == []


def test_label_and_unlabel_are_inverses():
assert unlabel_rgb(label_rgb((10, 20, 30))) == (10.0, 20.0, 30.0)

Expand Down
Loading