The color of the flame is dictated by the amount of oxygen mixed with the gas. It usually has to do with the orifice on the burner tube but there is usually a throttle if you will that you can adjust. It's really just a little flap of metal at the base of the burner.
The purpose is to entertain. It can be fun watching the different shapes created as the lamp gets warmer and depending on the colors it can set a mood.