How to theme my icon in the top bar for my new Gnome extension

I am creating a new Gnome extension. I have an icon as a PNG file that I add in a PanelMenu.Button to the top bar. This is working fine.

But I see the other icons in the top bar changing from black to white or white to black while moving back and forth in overview and normal mode. But mine is always staying white.

What should I do to get the same behaviour that I described for my own icon?

I solved my issue by simply using a generic icon available from Gnome itself.

I think you have to use a SVG icon instead of PNG, to support automatic recoloring.

1 Like