"An Imperial Stormtrooper fired at a Redshirt. He missed, and the Redshirt died anyway."
Starfleet utilizes three colors for their uniforms, red, blue, and gold/yellow. These pure primary colors that speak to the mindset of Starfleet. There isn’t time for frills and 80’s neon when you’re hurtling through space at Warp 8. By keeping the uniforms palette simple, Starfleet pays homage to its military roots while showing its bright future with easy to digest pops of color that designate a wearer's career.
Designating the wearer’s career is the main function of a Starfleet uniform. In TOS (The Original Series) gold was reserved for command, red was for engineering and security, leaving science and medical officers with blue. After TOS, command swapped with engineering and security while science and medical officers kept their trademark blue threads. We can easily pick out the science officers in a pack of Captains but why those colors for those specific positions?
Playing with the psychology of color, the theory that color impacts human behavior, we can get a peek into why Starfleet possibly made the choices it did. Let’s first break down the color meanings:
Red - Aggression, Importance, and Power
Yellow - Caution, Courage, and Inquisitiveness
Blue - Trustworthiness, Reliable, Confidence
Now, taking into account these supposed meanings, it’s easy to determine why command has bounced from red to gold and medical has stayed consistently blue. Crew members know Bones is a reliable doctor, even when he’s not asserting that point to Kirk because they’ve been conditioned to trust the blue uniform he wears.
Redshirts are known for dying frequently, a problem that plagues TOS, and when we consider that red invokes aggression and stands out more it’s easy to see why there are so many dead crewmen on the Enterprise’s roster. When we move to TNG (The Next Generation), we can see that Starfleet learned from this mistake by using a darker shade of red and placing the color on crew members who have roles of power and importance. Shifting the moving targets to officers who can hold their own and limiting the body count.
While security officers enjoy the hesitation their cautious yellow brings on trigger happy hostiles. Further ensuring they don’t become the butt of another away team joke.
With its simple color palette, Starfleet honors its roots, boldly goes into the future, lets us rest comfortable in our assumptions about the character of each officer due to the color they’ve earned, and even saves a bit on those all important Federation credits.