Advertisement
Intermediate .NET MAUI, Fonts, Icons & Media

How do you tint or recolor images and icons in MAUI?

Short answer

Use FontImageSource Color for icon fonts, or apply an IconTintColorBehavior (MAUI Community Toolkit) to Image controls to tint bitmaps at runtime. SVG-based MauiImage can be recolored at build time by editing the source or using tint behaviors.

Save .NET MAUI mock interview
Advertisement
AModel answer
Use FontImageSource Color for icon fonts, or apply an IconTintColorBehavior (MAUI Community Toolkit) to Image controls to tint bitmaps at runtime. SVG-based MauiImage can be recolored at build time by editing the source or using tint behaviors. Tinting supports theming without duplicating assets.
<Image Source="star.png">
    <Image.Behaviors>
        <toolkit:IconTintColorBehavior TintColor="Gold" />
    </Image.Behaviors>
</Image>
Real-world example
A rating widget tints the same star image gold or gray depending on state, avoiding two separate assets.
Likely follow-ups
  • How do you tint an icon font? | Where does IconTintColorBehavior come from?
Related topics