Dyeing works differently for each fibre you want to dye. For cotton you need different chemicals than for wool, etc, to make the dye adhere to the fibres. Dyeing with plant materials demands again different methods from dying with chemical dyes. Add to this the differences of the fibres you want to dye, and you can see that it becomes very complicated.
For dyeing fibres it pays to get a good book from you local library to learn how to go about it.
Onion skins give a lovely dye, but I doubt very much that it will dye an acrylic yarn. Nearly all fibres can be dyed, and Acrylic fibres among them. However that does not mean that you can do that at home, and certainly not with natural dyes, like onion ckins or marigolds.
After all this, I also do not think that you would be able to match the colour you were looking for.....LOL
The website below, gives a good discription of the ins and outs.
Els