It is possible to create variable products directly from a custom product setup page, but you may need to use WooCommerce’s variation system. You then have the possibility to configure a personalized product for each variation of a product.
In the case of a tshirt that has different colors, then start by creating the personalized products in different colors, for example, a black tshirt and a white tshirt. You should end up with two custom products as follows:

We then need to create the WooCommerce variable product and attach a personalized product to each variation.

We then create the attributes that will be used for the variations of our product.

We save the attributes then go to the “variations” tab.

Select “Create variations from all attributes” to create all possible combinations of variations or manually create your variations.
When your variations are created, you will then be able to attach a personalized product for each variation :

Once finished, save your product, your variable product is then usable.