This is something that Apple added in Mojave. If you do not make the change, then your app looks horrible in Dark Mode. Developers have to do this if they want people to use their apps with Mojave and dark mode.
Quote:
Apple’s new macOS 10.14 codename Mojave has a nice dark theme, but to change it you need to go click through multiple screens to change the theme.
To switch fast and simple I created a Menu Bar App for this. It does exactly what you see below with a mouse click.
Download the menu bar app via the button in the article.