PlotlyJS - Match trace color

I am using PlotlyJS to plot pairs of traces (raw data and lines of best fit). I’d like for each pair of traces to show as the same color. Is there a way to query the color used in a specific trace in order to reuse it later?

As an outline:

using PlotlyJS
t1 = scatter(;y=rand(5))
c = ... #here we get the color used in t1
t2 = scatter(;y=rand(10),marker_color=c)
plot([t1,t2])

Thanks in advance