Add attributes to the product

To associate the attribute “Colors” to the product, do exactly as you would do for any other attribute belonging to WooCommerce types.
Add the new attribute and values in the section Attributes in product page.

attributes

You can now configure the product settings through the created color attribute. There is an option to add a different (separated) image gallery for each of the product variations. In this case each color will have its own image gallery.

color variation images

The customers wil see a different image gallery for every color they pick:

product page frontend