Early metal roofs, called outside metal roofs, were simply sheet metal applied over the original wooden roof. Eventually, pressed steel roofs became available from several different manufacturers, each with its own distinctive pattern. When a railroad ordered a batch of boxcars, they'd specify which proprietary roof they wanted used, sometimes choosing to equip part of the order with one type and some of the cars with another. I'm not sure when galvanised roofs came into common use, but before that, many cars had a waterproofing material applied to the roof (and sometimes the ends, too) called roofing cement. This contained a tar-like substance and was often (but not always) black. It was applied only to the roof itself, not to the running boards, so the running boards might be painted black, or painted the same colour as the carbody.
Galvanised roofs were originally painted in whatever colour the railroad specified, but the paint didn't adhere well, so eventually it was eliminated. Since the cars are not masked for painting, new cars often show overspray of the car's colour along the edges of the roof.
Wayne