system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek] Why the swap between Red and Gold/Yellow Uniforms?

Two part question:  Why did the uniform colours change for Command and Security between the Original Series and Next Generation?

Would like to know on two different levels, namely the real-world television-studii answer (i.e. Patrick Stewart didn't like the colour)  AND the in universe thought process... what was Starfleets reasoning. 

(If this has already been answered, by redditing is rather weak, could someone point me in the right direction.)
gpt
Gold, or yellow, was originally chosen because human eyes see yellow faster. It was thought that in a crisis the yellow uniform would "pop" a bit more lending a CO a bit more authority.  

As the Federation and Starfleet expanded more and more species came into the fold that either couldn't see the color gold well or confused it with other colors.  

Red was chosen because it can be differentiated by a wider number of species and still carries the weight of authority.