I’m developing my own extension and would like to ensure the icon it places in the system status panel (tray) adjusts to the background of the panel so the icon is clearly visible with either light or dark shell themes.
I noticed some extensions have this functionality without any detection code and without including two versions of their icons. One of these extensions is: https://github.com/gpouilloux/gnome-shell-extension-docker. They use an SVG (docker.svg file) that’s filled white and yet on when the panel is light it gets drawn with a black fill.
What does it that their icon is ‘magically’ adapted?
My extension for reference.