You should be able to take the yellow onion to be absorbed by your red one. This should give you a few yellow Pikmin and allows you to make new yellow ones by having the yellow Pikmin take it to the combined onion.
Once the onions are combined, you can tell what color Pikmin will be created when things are absorbed by looking at the color of the numbers above the item. The number that show how many Pikmin are carrying it. Pikmin will make new ones of their color so if you want yellow you need majority yellow to carry it
If you already have the max number of Pikmin out, it will still make new ones. They just stay in the onion. Go into the light under it, press A, and you can change out for different colors.