Therin of Andor wrote:
The switch was because the TOS movies' use of wine red for all Starfleet officers' jackets, viewers had begun to associate wine with Admiral Kirk, Captain Spock and command.
Patrick Stewart tested better in wine (colour-shifted from TOS red) than mustard. It was also felt that using mustard for security diluted the old doomed "redshirt" jokes. The blue of science was colour-shifted to teal to avoid problems with bluescreen.
Moreover, Thesis used a darker color-value for the TNG uniforms. And the teal would continually be messed with throughout the life of the series, as Crusher's uniform color isn't very consistent from season to season.
TMP increased from three (TOS) to six division colours:
White: command, Science: orange; Ship's Services/Helm: yellow; Engineering: red; Medical: mint green; Security: grey. The uniform colours were officers' personal choice of grey or beige.
The uniform colors
had a specific meaning as well per the Sackett book (see the interview with Bob Fletcher).
Beige: bridge officers
Brown: Non-bridge personnel
Loden-green (looks dark gray): Planetary personnel
Of course, Ilia should've been in beige like Sulu, Uhura, and Chekov. But then again costuming is often dictated by what looks good on the actor/actress. Perhaps, and this is speculation on my part, they wanted Persis Khambata to stand out from the rest of the bridge rats since she had a prominent feature role in the film.
ST II-VI, plus "Generations" prologue:
White: command, Science/Ship's Services: grey; Engineering/Helm: yellow; Medical: mint green; Security: black; Cadet: red. In the background, several other collar/cuff colours could be seen. The uniform jacket colour was wine.
Black was the color for the enlisted personnel--as worn on their jumpers. Red was for both officer-cadet and enlisted-traniee. There was also a complex system for the shoulder and arm bands to further dilenate department and role--seen in TVH.
Security was a Windsor green per Fletcher's notes.
Those notes have been used to create this TWOK division chart.