Yellow GI fluids
Both the yellow diarrhea
and the yellow bile
color in vomitus are due to the same chemical, bile, which is produced by the liver. Normally you never see it in the stomach because normal eating keeps it moving down the GI tract.
But when you vomit, and if you're stomach has no food, then all there is to see is the bile. When you're not eating regularly, the same bile will make your stool yellow.