In the original Star Trek series, gold uniforms were command, red uniforms were engineering and security, and blue uniforms were science and medical. In The Next Generation, Deep Space Nine, and Voyager, red uniforms are command, gold uniforms are engineering and security, and blue uniforms are science and medical.—Preceding unsigned comment added by Icecreamdif (talk • contribs)
In the Original series, the green uniform that Kirk sometimes wore was never really explained, but since he was the only one who wore it, the implication is that it was some sort of special issue uniform just for Captains, or those in command.
Actually, the green uniforms (both of Kirk's wrap-arounds as well as the dress uniforms worn by Command personnel) were the same shade as the standard ones, which were also green. But they were made out of different material, so the standard uniform showed up as yellow under the lights and on film, and some stayed green. Later the green was "canonized."
Blue is the only color that meant the same in the TOS pilots, TNG on, and ENT, although the shade changed sometimes.