... more confusing than the jerseys on Star Trek.
Blue is for sciences, red is for services, green for command-line officers (
TOS). Technically, the department heads (Spock, Scott, McCoy) were in the chain-of-command, but chose their departmental uniforms. (The command pullover tops looked gold as a result of poor color reproduction--that's why the dress uniforms and Kirk's wrap-around were green.)
In
TNG, the scheme is similar: teal for sciences, gold for services, red for command.