I am plotting a 3d scatter plot in Plotly, similar to the example below. (Though in the actual plot, I have more data groups I'm plotting in various layers, so there's multiple entries in the legend.) I have to add color from a colorscale to each group of points. This has the unfortunate side effect of causing the color in the scatter point in the legend to be essentially a random color from this colorscale, rather than a specified one (on the darker end, for example). To see this effect, change the number in the _ = nprand.sample(1) line a few times and you should see the shade of blue in the legend point change.
import plotly.graph_objects as go
import numpy as np
import numpy.random as nprand
nprand.seed(1)
x = nprand.sample(100)
y = nprand.sample(100)
z = nprand.sample(100)
_ = nprand.sample(1)
color = nprand.sample(100)
trace = go.Scatter3d(x=x,
y=y,
z=z,
name="sample",
mode='markers',
marker=dict(
symbol='circle',
size=20,
color=color,
colorscale="Blues"))
fig = go.Figure(trace)
fig.update_layout(showlegend=True, legend=dict(bordercolor='black', itemwidth=100))
fig.show()
How can I specify a specific color for the point in the legend?

