T-Shirt. And inside the T-Shirt product, there would be variants for
Size. This then makes it easy for developers, as all the data is there on the one product to create the product selector, images, etc.
Colorin this case, and make 4 separate products:
Green T-Shirt, and
Yellow T-Shirt. Because the products are now separated, this makes the product experience for both merchants and developers a little more cumbersome.