Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the color of the icon in mudblazor or add more colors to the enum Color?

Tags:

mudblazor

<MudNavLink Href="/saasform"  Icon="@Icons.Material.Filled.InsertDriveFile">Risk Summary Accepted</MudNavLink>

I want to change the color of the displayed icon and I can do it by adding IconColor="Color.Primary" and the code looks like

 <MudNavLink Href="/saasform" IconColor="Color.Primary" Icon="@Icons.Material.Filled.InsertDriveFile">Risk Summary Accepted</MudNavLink>

But we are restricted to use only few colors like Color.Primary, Color.Secondary, Color.Dark etc., How do we set the color of the icon as desired ?

like image 501
Venkat Avatar asked Nov 22 '25 15:11

Venkat


1 Answers

You can't set an arbitrary color, only those defined in the Color enum. Note that those colors can be changed by changing the theme.

Note that there is a feature request to add arbitrary colors: https://github.com/MudBlazor/MudBlazor/issues/470

like image 75
Bart Kiers Avatar answered Nov 25 '25 11:11

Bart Kiers