Is it possible to change the color of an icon based on certain parameters? E.g.: When muted, show red mute icon?

I'm new to BTT and a touchbar mac, so far, with GoldenChaos-BTT, I'm in love! But I'm wondering if there is a way in general to change the icon color based on some simple booleans? If muted = icon color is red?

There should be using Applescript but the command isn’t working at the moment. I posted a bug report about 12 days ago.

I don't know about apple script, but webserver endpoint seems to be working fine (color of the widget can be changed)

See the solution at my post above - update_trigger with properly escaped json should work.

Existing solutions change the widget/button background color, not the icon color. Right now if the icon .icns file is black, the icon will appear in white or black depending on the background color. Is there a way to customzie this? e.g. with the json return value?

e.g. support for data['icon_color'] = '255,255,255,255'