Change color of components to values loaded from a webserver at runtime

Hello there,

i need to set the color of components (text and background) dynamically to color values loaded from a web server at runtime.

Methods that i already tried out:

In HTML:
<ion-navbar [style.background-color]="#FF00FF" …
<ion-navbar [style.color]="#FF00FF" …

In TS:

@ViewChild(‘navBar’) navBar;

ionViewDidLoad() {
this.navBar.nativeElement.style.backgroundColor = ‘#ff00ff’;
}

Is there any way to achieve this?

Thanks in advance!