Plotly express line plot with continuous color bar (instead of discrete colors)

I would like to create a line plot with plotly express (px.line) with a continuous rather than discrete color scale. px.scatter gives the desired color behavior, but I want either just the lines or lines+markers.

Trying something similar with px.line gives me the lines I want, but discrete colors instead of a continuous color bar. Is it possible to create a px.line() plot with a continuous color axis instead of discrete?