File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/python/plotly/plotly/figure_factory Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import absolute_import , division
22
3- from plotly import exceptions , optional_imports
43import plotly .colors as clrs
4+ from plotly import exceptions , optional_imports
55from plotly .figure_factory import utils
66from plotly .graph_objs import graph_objs
77from plotly .validators .heatmap import ColorscaleValidator
@@ -147,9 +147,10 @@ def create_annotated_heatmap(
147147
148148
149149def to_rgb_color_list (color_str , default ):
150- if "rgb" in color_str :
151- return [int (v ) for v in color_str .strip ("rgb()" ).split ("," )]
152- elif "#" in color_str :
150+ color_str = color_str .strip ()
151+ if color_str .startswith ("rgb" ):
152+ return [int (v ) for v in color_str .strip ("rgba()" ).split ("," )]
153+ elif color_str .startswith ("#" ):
153154 return clrs .hex_to_rgb (color_str )
154155 else :
155156 return default
You can’t perform that action at this time.
0 commit comments