What's the difference between yellow mucus and green mucus?

Phlegm color. There is no difference per se. Phlegm is a mix of sloughed lining cells, white blood cells, mucus, bacteria, etc. The color of mucus tells you how much inflammation is present. The significance of phlegm color is limited if any.
Shades of color. Both yellow and green mucus indicate pus and break down of cells with possible bacterial growth indicating an infection. Smokers have chronic inflammation in their lungs and can have purulent mucus without an infection. Anyhow, you ned to have it checked.