How to support different themes/modes for buttons

I made a UI and I want to add a button that changes the borders and background colors for all the buttons in the interface, similar to the color picker in the widgets demo. So it would essentially be my default style and another custom style that is enabled by selecting the button .How would I accomplish this?