User selectable colors in Plotly JS Chart

I need to be able to let the user select different color options for data on our charts. This would ideally be accessed via the legend, but any way I can do this would be fine. If there’s an example somewhere that would be even better! Thank you!