Skip to content

Commit 75ee6e1

Browse files
easily access canonical list of named colorscales
1 parent 29cdd6b commit 75ee6e1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: packages/python/plotly/_plotly_utils/colors/__init__.py

+9
Original file line numberDiff line numberDiff line change
@@ -797,3 +797,12 @@ def convert_colorscale_to_rgb(colorscale):
797797
for color in colorscale:
798798
color[1] = label_rgb(color[1])
799799
return colorscale
800+
801+
802+
def named_colorscales():
803+
"""
804+
Returns lowercased names of built-in continuous colorscales.
805+
"""
806+
from _plotly_utils.basevalidators import ColorscaleValidator
807+
808+
return [c for c in ColorscaleValidator("", "").named_colorscales]

0 commit comments

Comments
 (0)