The color of your iPhone’s battery icon could be white or black depending on the appearance of your iPhone’s display Light or Dark mode. Below are a few photos showing you the color of white or black battery icon for your comparison.
The reason why your iPhone’s battery icon is black is because when your display mode has been set to Light Mode. If you have set your display mode to Dark mode, the battery icon will turn white. So by changing the display mode of your iPhone, the battery icon color will automatically switch between black or white to be in contrast with the background color for visibility. This is only difference in colour scheme which have total no effect on your battery condition and no battery problems at all.
You can change your iPhone’s display mode from Light to Dark mode or vice versa in the settings > display & brightness > select Dark or Light mode.