A lot of misinterpretations have crept into the mix over the years. Going by first sources (the original films, before there was much of an EU to muddy things):
ANH gave us officers addressed with Army-like ranks in steingrau (an irritating gray-green that looks more one or the other depending on lighting, camera filters, angle, etc.) two-piece uniforms. ESB used those same uniforms with officers being addressed with both Army and Navy style ranks. Thus, we concluded ages ago it's a combined service. Ground forces are useless without ships to move them from planet to planet, star system to star system... And ships on their own can't take and hold planets.
ANH also gave us light-gray-uniformed personnel -- mostly one-piece jumpsuits, but also one officer with light-gray jacket and black breeches and cap. That officer was only seen in ANH, but the jumpsuited personnel are seen through the OT in technical roles -- scanner techs, comm techs, armored-vehicle drivers.... They've been loosely postulated to be Combat Engineers or Construction Battalion analogues.
ANH also gave us personnel in black one-and-two-piece uniforms. They were seen in the boarding of Leia's ship and in guard and gunnery stations aboard the Death Star, as well as the TIE fighter pilots. The jumpsuits are the same ubiquitous pattern used across Rebel and Imperial forces throughout the OT, but the two-piece uniforms are a slightly different cut from the previous two types. Further, those two-piece uniforms are seen on officers with plaques, a presumed non-com without a plaque, and even on some of the black-helmeted guards. Those, at least, were always presumed to be part of the same command, otherwise what's the point of a uniform. The Marine-like context has led me and others to conclude those are the non-combat uniforms for Stormtroopers.
Lastly, ANH also gave us a couple guys in black breeches and caps, with off-white jackets that were made of a lighter fabric and had an even more substantially different cut to them than the above. No breast pockets, and the front placket overflap only goes about half as far over as the standard jackets', and doesn't go up to the shoulder. I remember in the '90s when people were first getting widespread looks at the OT in widescreen, and "Yularen" (as Decipher named the character in their card game) was "rediscovered". Many people thought he was a Grand Admiral, as the Thrawn Trilogy had been published recently, with that uniform being described therein. Others cooly pointed out we can see him and another individual in identical dress walking by the elevators where Our Heroes are waiting to go up, and it's clear in that shot that their uniforms aren't all-white (and the jackets aren't white, anyway, compared against the white of the Stormtrooper armor).
But that persists up to the present. Dave Filoni made Yularen an Admiral in Clone Wars as backstory to him being a Grand Admiral in ANH. He was genuinely surprised when it was pointed out to him that Yularen wasn't a Grand Admiral, and why. The costume dude who designed Krennic for Rogue One also cited that uniform and that scene, also "loving Yularen's Grand Admiral uniform" and modeling Krennic's on what he thought he'd seen. But because they're working on actual official canon, unless someone stops them before, their misinterpretations make it in.
Also, the Imperial gunner uniform was black leather. I could argue either way on that. Could just be protective gear, and they're not Stormtroopers... Or, since leather can come in any color, the fact that they went with black indicates they are...
For Solo? The Mudtroopers (really, IMO, just Imperial Starfleet infantry with theater-specific ponchos and such) are wearing the same steingrau uniforms of the OT, so they're part of that branch of the Imperial military. The Patrol Troopers seem to be more paramilitary, as with the Coruscant Shocktroopers and guards -- being more martial-law police than active combat troops... But still nominally part of the Stormtrooper branch. It's easy to argue the light-gray uniforms and armor of the AT-AT drivers in ESB indicates they go through advanced training wherever it is the tech branch operates. (Lengthy sidebar on other new troop types in Rogue One omitted -- Shore Troopers, Tank Drivers, and AT-ACT drivers. Much to unpack there...) The fighter cockpit is too dark to see clearly what color flight suit Han is wearing. It seems black... but less black than his armor. Could just be tricks of lighting, could indicate a charcoal-cray jumpsuit. *shrug* And his helmet being black is nothing solid. The OT TIE pilots had black helmets, and I'm pretty sure they weren't all Shadow Troopers.
I've seen it argued, convincingly, that the black caps and helmets worn by the various non-black-uniformed personnel through the OT indicate, essentially, a combat-centric or combat-only role; whereas the steingrau caps worn by others in non-steingrau uniforms (mainly bridge techs in gray jumpsuits, alongside other bridge techs in gray jumpsuits with black caps) indicate more of a "bigger-picture" role. Same reason Clone Troopers and Stormtroopers have non Clone/Stormtrooper Generals. What that significance specifically is has only been speculated from all sides, but that there's something to that is widely agreed-on.
So that's the short breakdown of Imperial uniforms in the OT, derived from on-screen material, and bringing in as little of the EU as possible, considering how many things EU contributors got wrong, or conflicted with other EU sources.