My cats have done this several times. The white foam usually means they have a very upset stomach. The green is from eating grass! When a dog or a cat has an upset tummy, they have a sour stomach and the chemicals in the grass counter-reacts the acids in their tummies. If however this continues on a regular basis, you may want to try changing their diet. If no luck with that, seek a Vet...GBY
My cat vomited white foam and I saw some grass in it, so all it really means is that your cat has eaten grass and your stomach does not think its good.