For a very long time I’ve been trying to figure this out WHAT does the red, blue, and sometimes yellow means on a Officer of the Empire? For example does red mean Command, or what about blue below?

For a very long time I’ve been trying to figure this out WHAT does the red, blue, and sometimes yellow means on a Officer of the Empire? For example does red mean Command, or what about blue below?

From Rogue One: The Ultimate Visual Dictionary:
Imperial Insignia
A plaque with an arrangement of colored rectangles denotes rank. Sector-specific design schema creates a hodgepodge of non-uniform rankings.
So it does signify rank, but there's no consistent meaning to the colors.
A few of the plaques seen in other pages of that book:
Director Krennic: Six Red blocks on top of Six Blue blocks (the book notes that this is the Fleet equivalence of admiral)
Lieutenant Valdas: Two Red blocks followed by 1 Blue block
Lieutenant (Jr Grade) Chasser: Two Blue blocks
Republic/Galactic Officer Rank Insignia:
These were metal backings with color squares attached to said backing to signify officer ranking. The purpose of these insignia was to help other military personnel identify officers from a distance / to differentiate rank. These plaques were used by the Galactic Republic and the Galactic Empire. The First Order used shirt collar insignia, much like the United States Navy. The Republic and the Empire also used code cylinders that had special access codes and information.
The colors of the square were blue, red, and gold. The different colors had no specific meaning, but different combinations created different meanings/insignia.
Sources:
http://starwars.wikia.com/wiki/Rank_insignia_plaque/Legends http://starwars.wikia.com/wiki/Rank_insignia_of_the_Galactic_Empire/old_version