It does not work on a frontend produt list, but It works on a frontend product view.
You should set the product as configurable.
Then you should add simple variations to it.
Then you should upload different images for the simple variations.
Then a visitor selects a color in the frontend product view, Magento 2 changes the product image autimatically.