The patch makes so that buttons with a fixed background, like as an example the outilner restriction toggles, always use the regular text color, since their active/inactive state is defined by changing the icon itself.
Before and after the patch with the default Blender Light theme:
{F11770666} {F11770668}
This solves the immediate problem, but theme customizability is still limited, since these "regular" icons are drawn in all sort of places.
I think that the best thing here would be to get the theme settings from the region/panel where the icon is drawn, but I don't know if it's possible to get them from `ui_draw_but()`.