Skip to content

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

Description

@simonm3

The docs say "This function takes either an ‘rgb(a, b, c)’ color or a list of such colors" but a list fails.

windows 10, plotly 4.14.3

from plotly.colors import *
colorset = sequential.YlOrRd
print([unlabel_rgb(c) for c in colorset])
print(unlabel_rgb(colorset))

[(255.0, 255.0, 204.0), (255.0, 237.0, 160.0), (254.0, 217.0, 118.0), (254.0, 178.0, 76.0), (253.0, 141.0, 60.0), (252.0, 78.0, 42.0), (227.0, 26.0, 28.0), (189.0, 0.0, 38.0), (128.0, 0.0, 38.0)]

ValueError Traceback (most recent call last)
in
2 colorset = sequential.YlOrRd
3 print([unlabel_rgb(c) for c in colorset])
----> 4 print(unlabel_rgb(colorset))

~\Anaconda3\Lib\site-packages_plotly_utils\colors_init_.py in unlabel_rgb(colors)
741 str_num = str_num + char
742 else:
--> 743 numbers.append(float(str_num))
744 str_num = ""
745 return (numbers[0], numbers[1], numbers[2])

ValueError: could not convert string to float: ''

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokendocumentationwritten for humans

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions