I am using the ionic 4 fab button, in the fab button I want to set a dynamic background color.
here example code:
page.html
<!-- fab placed to the bottom end -->
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button [style.background.color]="currentColor" [style.color]="isColorLight(currentColor) ? 'black' : 'white'"
size="small">
<ion-icon name="color-palette"></ion-icon>
</ion-fab-button>
<ion-fab-list side="top">
<ion-fab-button (click)="switchColor(i)" [style.background.color]="colors[i]"
*ngFor="let color of colors; let i = index">
</ion-fab-button>
</ion-fab-list>
</ion-fab>
Well If I user as @danielmm1997 said but it’s working with var color. My question is I want to use custom color as in the question. Thank you for your time @PratikVaity and @danielmm1997