To use multiple themes check this guide and to generate color palette we often use this Material Design Palette Generator, having those you can configure color theme like this, for example:
...material custom theme implementation from guide...
...
.red-theme {
@include angular-material-theme($red-theme);
@include custom-components-theme($red-theme);
....
}
Now you can use .red-theme class on body to change colors. The best way I found is to prefetch some string like color-palette: "red-theme"
from your backend API in APP_INITIALIZER hook (how it works ref) and use it via service:
theme.service.ts
setColorPalette(colorPalette) {
const body = document.querySelector('body');
body.classList.add(colorPalette);
}