Skip to content

plotly.graph_objects.scatter3d.Marker color incorrect HSV/HSL interpretation #4382

Open
@MrSo0der

Description

@MrSo0der

I'm using the latest 5.17.0 Plotly version an ran into a problem, which the following code can describe:

import plotly.graph_objects as go


fig = go.Figure(data=[go.Scatter3d(x=[0], y=[0], z=[0], marker=dict(size=12, color='hsv(100, 100%, 75%)')),
                      go.Scatter3d(x=[1], y=[1], z=[1], marker=dict(size=12, color='hsl(100, 100%, 75%)')),
                      go.Scatter3d(x=[2], y=[2], z=[2], marker=dict(size=12, color='hsv(340, 100%, 75%)')),
                      go.Scatter3d(x=[3], y=[3], z=[3], marker=dict(size=12, color='hsl(340, 100%, 75%)'))])

fig.show()

So expected colors for traces 1-4 are #40BF00, #AAFF80, #BF0040 and #FF80AA or close to them. And here is the output plot:
Untitled-1
Traces got colors #AAFF7F, #AAFF7F, #9F7FFF and #9F7FFF respectively, so only trace 2 got correct color.
Some of my conclusions:

  1. No matter which color model is chosen (HSV or HSL), it will be interpreted as HSL.
  2. The '360 degrees' hue notation is used for HSL, but 8-bit integer expected, which means every hue from 256 to 359 is rounded to 255 and not accessible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions