Luckily, Photoshop exposes a number of theme-specific CSS variables that are perfect for making your plugin respond to the user’s theme color choice. These variables are:
I was also looking to change the Background Color of an SP-Action-Button when it’s active but had no success so I came to the conclusion its not available
Yes: The application has a property called kuiBrightnessLevel indicating the current theme. It can have the following values: 'kPanelBrightnessDarkGray' | 'kPanelBrightnessMediumGray' | 'kPanelBrightnessLightGray' | 'kPanelBrightnessOriginal'
In order to stay up-to-date, you can set up and event listener for the set event and then check if it matches a specific pattern to see if this specific settings was changed. This is how the set event descriptor would look like:
Yes that works, too. I though you were explicitly looking for a solution to change HTML, but if you only need to switch the image, the CSS background / background-image property also works fine.