Color of uniform in TOS, TAS, and TNG DOES mean something. It indicates the specialty of the character within Starfleet.
In the movies 2-9 (Maroons and TNG movies), the undershirt color and the strap color indicates specialty.
Most militaries use color for specialty, and have done so since the 1800’s or before, at least on dress and office uniforms; field and battle not so much since WW I.
Many use different base colors for different services, and in some cases, with the same color coding of insignia to indicate specialties. (In the US, for example, the USCG and USN have different base color dress/office uniforms, but the accent colors of E1-E3 stripes on uniforms where they’re a patch indicate department the person is assigned to.) The UK Royal Navy used color flashing on officer insignia, between the stripes, to indicate officer fields. The Canadian forces all wear the same uniform in different base colors, and enlisted stripes in different colors, to indicate which service the person is serving in. Current USN carriers use colored turtlenecks to indicated role of crewmen in shipboard uniform, especially the deck crews.