(covers information from several alternate timelines)
The command division was the corps of officers within Starfleet who specialized in command and control functions on starbases, aboard starships, and at Starfleet Command. Members of the command division were trained in leadership and had tactical training allowing them to decisively take action in organizing and mobilizing Starfleet crews to perform missions. Command officers included most all of the admiralty, captains, executive officers, adjutants, pilots, and flight controller (or helmsman). Command division personnel also filled posts as tactical officers and sometimes in ordnance departments.
An officer who belonged to the command division sometimes wore the division color of another department in which they specialized if said command officer became a security chief, engineer, or commanded a science department.
Gold was again the color of the command division throughout the 2250s and 2260s, worn by line officers and flag officers of this division. Officers in the command division wore a five-pointed star with a lengthened upper point as an insignia on their assignment patch.
By the 2270s, new uniforms showed different division colors, the command division was signified by white backing their Starfleet badge, and also on uniform bands and epaulets. This continued onto the 2280s uniforms, and the insignia used gave the officer the option of wearing command division white uniform insignia, with another department color banded across, or the opposite, with department color insignia with command white banded across.
By the uniforms used from 2350s onward, red had become the command division color, and this continued through several uniform styles.
Individuals from several possible futures, and some that have been proven to be alternate timelines, continued to wear red when in the command division, but by the 29th century, several timelines had switched the command color to blue.
|Starfleet uniform command division colors:|
|22nd century||2230s||2250s-2260s||AR 2250s|| Mid 2260s-|
|Mid 2270s||Late 2270s-2350s||2350s-2370s|| Late 2360s-|
|Helm and Navigation||Helm|
Captain Braxton wore blue in VOY: "Future's End, Part II" and "Relativity", but an alternate version of him in "Future's End" wore red – indicating that Starfleet never changed the command color in that version.
During the original series, command gold was regularly worn by the captains, admirals, helm, and navigation officers, but was also seen on phaser room ordnance crews, with some exceptions. In Where No Man Has Gone Before both the Helm and Navigator wore Operations division colors. Communications Officer Uhura briefly wore command gold, as did Executive Officer Spock, but they switched over to other department colors over the course of the series. The work coveralls were originally muted variations on the division colors with the Command division being represented by olive green, then later matching the duty uniforms. This coincides with the actual color of TOS which was lime green and only appeared gold under the lights. If color correction technology in 1965 was as sophisticated as today's, Command would have never been gold and TNG Operations division might have become green. (citation needed • edit)
In the movie era, Saavik wore command white despite having a dual position as science specialist (as did Spock, but he was a captain at this point). The costume department had planned to give her uniform a science department color swatch also, but in an error, it was never seen on film. The schemes and insignia of the Star Trek films era uniforms were designed by Robert Fletcher.
The purpose of the colors was only obvious through inference, but in DS9: "Trials and Tribble-ations", gold was established in dialog as the "old" style command color (and red as the "new" command color). The decision to switch the meaning of the colors between the TOS and TNG uniform styles was made in pre-production of "Encounter at Farpoint".
Most often, in the Federation Starfleet, all captains and admirals wore command division colors; however there were exceptions which prove that this was not a requirement. In TOS, two commodores, Stone and Stocker, wore red operations division uniforms, and Captain Krasnovsky wore sciences division blue. In the movie era, Scotty switched back and forth from command white to engineering gold after receiving his captain's bars (ironically, he effectively used them in the "wrong" scenarios, wearing gold with his formal duty tunic but white with the more casual bomber jacket and engineering vest). In TNG era productions, DS9: "The Die is Cast" had an admiral named Toddman who wore operations division gold, despite every other Starfleet captain and admiral ever seen in this era wearing command colors.
The closest real-world comparison to the Starfleet Command Division would be the Unrestricted Line Community of the United States Navy.