Coloring data points in Scatter Plot (Plotly) based on selection

Hi everyone,

is there a way to change the color of the data points in a scatter plot (plotly) based on the selection of the data points themselves?

What I mean is: I have a scatter plot and I select some specific data points on it. As a result, I would like to see all the points selected colored with a certain color (example: red) and the rest of the points colored automatically in black, in a binary fashion.

I would like to have this feature on the same plot that I’m looking at.

Any idea on how I can achieve this?

Any suggestions would be much appreciated!

Thank you very much!