You have to dilute the colours before hand. It's really the only way. You add enough conditioner to the dye so that it doesn't dilute the colour at all. You just want to even out the amount of pigment in the dye so it's not going to be coming out in huge amounts. It still might stain the yellow a bit, but it will help a lot.
Once you've done that, avoid using shampoo and it'll stop even more coming out when you wash.