Understand, that prior to the ACW, all infantry regiments were regular regiments in the US army. Blue and white were the colors used. When the south broke from the north, they were still using federal uniforms and equipment, and since many of the federal military academies were in the south, like the prestigious Virginia Military Institute, where Thomas "Stonewall" Jackson conducted teaching and drill, the uniforms given to the cadets and soldiers were that of "northern" (as we know them) uniforms. It wasn't until a little after the battles at Manassass that the Rebels began recruiting large amounts of volunteers, of which many had no standard uniforms and many wore regular civilian clothes and had to provide their own equipment and guns, that we saw grey become the color of regular infantries. There were reports of the 33rd Virginia being shot at by friendlies because of these blue uniforms. The casualties from friendly fire, I am not sure of. Many battlefields, to poets, journalists, artists, etc., became known as "Fields of Blue and Grey."
That's the best I can say without spending hours of research. This is taken from knowledge. Maybe Millander will pop in and correct/or add to what I said.