(colorscale_name, loc)
| 5 | |
| 6 | |
| 7 | def get_color(colorscale_name, loc): |
| 8 | from _plotly_utils.basevalidators import ColorscaleValidator |
| 9 | # first parameter: Name of the property being validated |
| 10 | # second parameter: a string, doesn't really matter in our use case |
| 11 | cv = ColorscaleValidator("colorscale", "") |
| 12 | # colorscale will be a list of lists: [[loc1, "rgb1"], [loc2, "rgb2"], ...] |
| 13 | colorscale = cv.validate_coerce(colorscale_name) |
| 14 | |
| 15 | if hasattr(loc, "__iter__"): |
| 16 | intermediate_colors = [get_continuous_color(colorscale, x) for x in loc] |
| 17 | return intermediate_colors |
| 18 | return get_continuous_color(colorscale, loc) |
| 19 | |
| 20 | def get_continuous_color(colorscale, intermed): |
| 21 | """ |
no test coverage detected