One of my pokémon had the black ball type, and when it evolved, it changed to the yellow rapid-firing ball type. Is it determined by IVs, EVs, Natures, highest base stat, etc? (I mostly trained on Sp. Atk.)
It is determined by the Pokemon itself. For example, a Caterpie will always have a black ball type, no matter what.
Source, List of Pokemon by ball type
Hope I Helped!