I know when setting the color for a FontImageSource you can use things like:
Color="#512BD4"
to change the color of the icon, but how do you apply the same logic to the splash screen setting as this:
<MauiSplashScreen Include="Resources\Splash\popup_splash.svg" Color="#512BD4" BaseSize="256,256" />
only seems to set the background color of the screen. The icon defaults to black and there aren't any hints in the designer.
CodePudding user response:
Use an image editor that can edit .svg files, to set the color of the foreground shape(s).
[OPINION] IMHO, there is no option to "set foreground color" because there can be MULTIPLE colors in an .svg.
Also, for cross-platform compatibility, Maui converts the .svg into a .png, when building the app for each platform. That is what gets displayed on the device. This conversion is done without any knowledge of that XAML (that later displays the splash screen image on top of the colored background).
Because Maui runs on multiple platforms, expect to see functionality that is easy to implement on all the platforms, and is in high demand by app developers. [OPINION] Being able to dynamically "colorize" a splash screen while the app starts up is not likely to be a high priority "wish" for many app developers.
The "background color" is different, because that simply fills in behind any transparent areas of the image. Easily done on all platforms that Maui targets.
CodePudding user response:
You can try to set the TintColor
attribute to your MauiSplashScreen
like below:
<MauiSplashScreen Include="Resources\Splash\popup_splash.svg" TintColor="#512BD4"/>