Clickable colour swatches - Image change

Hey Guys

I’m creating an e-commerce style website with products that are available in different colours. I’ve added swatches to my product page and have a Slider element with all of the different colours.

I’m struggling to find a way to link up a swatch click to a change of product colour on the slider.

I thought about creating multiple slider elements and doing show/hide but thought this might be the wrong way to do it, duplicating lots of elements.

Any help would be appreciated!