Often my tray will turn black every once and a while. It's likely related to the way polybar handles fullscreen since it has to stop drawing the tray seperate from the regular bar. The cause is likely that the tray isn't being notified to draw again after fullscreen mode is exited. The only way to fix the issue is to kill and restart polybar.