Custom color ion-header without sass variables

Hello, in my app I receive an hex color from the backend and I need to set this color at the background of ion-header.

What is the best way to do this?

I’m using ionic (Ionic CLI) : 3.16.0

Thanks.

ngStyle ? but please be aware that you should then also set the text color that you don’t get dark on dark or light on light colors.

You could use Renderer2 for that.
Create css classes or use styles and apply them with the methods from Renderer2. These are addClass, removeClass, setStyle and removeStyle.

Here you find a tutorial:
https://www.concretepage.com/angular-2/angular-4-renderer2-example