Is it possible to dynamically update scatter color range from continuous to discrete?

I have a px.scatter graph that plots some (x,y) data. I would like to offer buttons allowing the user to choose how to color the dots, based on other dataframe columns.
However, some of the columns have strings (and require discrete colors), others have numeric values (and require continuous colors).

I’ve tried using update_layout, but when I switch, the colors of the graph change accordingly, but not the color scale on the right side.

        cluster_dimensions = ['status_str',  # a string 
                                         'input_duration'   # a number 
                                        ]

        fig = px.scatter(encs, x='queued_duration', y='running_duration',
                         marginal_y='histogram',
                         marginal_x='histogram',
                         color=cluster_dimensions[0],
                         **opt_args
                         )

        buttons = [
            dict(method="update",
                 args=[{'marker.color': [encs[dim]]},
                           {'coloraxis.colorbar.title': dim}],
                 label=dim)
            for dim in cluster_dimensions
        ]

        fig.update_layout(
            updatemenus=[dict(x=0.99, y=0.96,
                                         xanchor='right', yanchor='top',
                                         active=0,
                                         buttons=buttons)])

Looking good on initial load:

But the scale is not correct when switching the dimension: