SfPopup.PopupStyle set a different color for OverlayColor

I'm using SfPopup.PopupStyle to set the OverlayColor

1.- When I set the OverlayColor with XAML


<sfPopup:SfPopup x:Name="sfPopup"
OverlayMode="Transparent">
<sfPopup:SfPopup.PopupStyle>
<calendar:PopupStyle OverlayColor="#e7b04a40"/>
sfPopup:SfPopup.PopupStyle>
sfPopup:SfPopup>


I got this result:

Image_3788_1692981993955


2. When I set the OverlayColor by code behind


<sfPopup:SfPopup x:Name="sfPopup"
OverlayMode="Transparent">
sfPopup:SfPopup>

public MainPage()
{
InitializeComponent();
sfPopup.PopupStyle = new Syncfusion.Maui.Popup.PopupStyle
{
OverlayColor = Color.FromHex("#e7b04a").WithAlpha(0.25f)
};
}


I got this result

Image_8046_1692982204178


Take into account that:

- #e7b04a is RGB (231, 176, 74)

- #e7b04a40 is RGBA(231, 176, 74, 0.25)

Is there a workaround for that?


1 Reply

DV Diwakar Venkatesan Syncfusion Team August 28, 2023 01:30 PM UTC

Hi Junior Saravia,


We would like to inform you that, in .NET Maui, the primary format for specifying a color using hexadecimal notation is #rrggbb and #aarrggbb, not #rrggbbaa. Please refer to the attached documentation below. Therefore, we recommend using #40e7b04a instead of #e7b04a40.


https://learn.microsoft.com/en-us/dotnet/maui/user-interface/brushes/solidcolor#use-hexadecimal-notation


We hope that this helps you. Please let us know if you need further assistance.


Regards,

Diwakar V


Loader.
Up arrow icon