The color of snot is caused by different things. Normally it is clear. Sometimes if you have an infection such as bronchitis white blood cells and iron containing coenzymes fighting the infection cause the greenish color.
This usually happens when someone has a sinus infection. The green and yellow coloring indicates the body is trying to fight off the infection. Normally, mucus in the nose should be clear or milky in color.