Hi
The different colors results from different regions of the nebula gas being at different temperatures. Gases emit different colors at different temperature becuase different atoms are responsible for emitting most of the light.
But be careful when looking at astronomy pictures, including solar astronomy! Usually, an astonomy image is taken with a filter or detector that sees only a narrow range of color; the resulting image is "black and white". The object might then be photographed in several different color ranges. Then the images are combined by assigning a color to each color range to give you the beautiful color images that you see.
Many of the images of the Sun are taken in ultraviolet light that your eye can't even see!
Hope this doesn't confuse things...
Paulett