Simplest solution IMHO: Change a class, that in turn changes the default color:
html {
--defaultColor: teal;
}
html.someOtherDefaultColor {
--defaultColor: rebeccapurple;
}
$("#clickToChange").click(function(){
$(html).toggleClass("someOtherDefaultColor");
});