How to set selected icon for toolWindow (new UI)?

Selected icon (e.g. GitHub copilot which is gray when not selected):

You can only specify icon attribute for toolWindow in plugin.xml?

Or is this done dynamically in ToolWindowFactory? Code example?