I solved that problem by adding a light colored glow outside the dark colored text and by using transparent background.
With that, same logo is being used on both light and dark themes without any visual differences and loss of branding.
Light theme: That light anti alliased glow is not noticable at all.
Dark theme: That glow makes the text (or logo) visible and separable from the black background and looks fine.
Just for your info