Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 35cbe11

Browse filesBrowse files
Merge pull request #3478 from janosh/master
Fix to_rgb_color_list when passing rgba colors
2 parents 6a023af + 9a9a67c commit 35cbe11
Copy full SHA for 35cbe11

File tree

Expand file treeCollapse file tree

2 files changed

+8
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-5
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## UNRELEASED
66

7+
### Fixed
8+
- Fixed ValueError when `ff.create_annotated_heatmap` passes `rgba()` colors into `to_rgb_color_list` [#3478](https://github.com/plotly/plotly.py/issues/3478)
9+
710
### Added
811

912
- `text_auto` argument to `px.bar`, `px.histogram`, `px.density_heatmap`, `px.imshow` [#3518](https://github.com/plotly/plotly.py/issues/3518)
@@ -15,7 +18,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1518
- texttemplate for histogram-like traces
1619
- text for heatmap-like traces
1720

18-
1921
## [5.4.0] - 2021-11-15
2022

2123
### Fixed

‎packages/python/plotly/plotly/figure_factory/_annotated_heatmap.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/figure_factory/_annotated_heatmap.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import, division
22

3-
from plotly import exceptions, optional_imports
43
import plotly.colors as clrs
4+
from plotly import exceptions, optional_imports
55
from plotly.figure_factory import utils
66
from plotly.graph_objs import graph_objs
77
from plotly.validators.heatmap import ColorscaleValidator
@@ -150,9 +150,10 @@ def create_annotated_heatmap(
150150

151151

152152
def to_rgb_color_list(color_str, default):
153-
if "rgb" in color_str:
154-
return [int(v) for v in color_str.strip("rgb()").split(",")]
155-
elif "#" in color_str:
153+
color_str = color_str.strip()
154+
if color_str.startswith("rgb"):
155+
return [int(v) for v in color_str.strip("rgba()").split(",")]
156+
elif color_str.startswith("#"):
156157
return clrs.hex_to_rgb(color_str)
157158
else:
158159
return default

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.