Color issues

This commit is contained in:
2026-01-17 03:36:37 +00:00
parent aad915ad86
commit a367365ce5
46 changed files with 970 additions and 443 deletions

View File

@@ -171,7 +171,7 @@ public partial class FlyoutPageHandler : ViewHandler<IFlyoutView, SkiaFlyoutPage
if (flyoutView is FlyoutPage flyoutPage && flyoutPage.Background is SolidColorBrush solidBrush)
{
handler.PlatformView.ScrimColor = solidBrush.Color.ToSKColor().WithAlpha(100);
handler.PlatformView.ScrimColor = solidBrush.Color.WithAlpha(100f / 255f);
}
}
}

View File

@@ -89,7 +89,7 @@ public partial class IndicatorViewHandler : ViewHandler<IndicatorView, SkiaIndic
if (indicatorView.IndicatorColor is not null)
{
handler.PlatformView.IndicatorColor = indicatorView.IndicatorColor.ToSKColor();
handler.PlatformView.IndicatorColor = indicatorView.IndicatorColor;
}
}
@@ -99,7 +99,7 @@ public partial class IndicatorViewHandler : ViewHandler<IndicatorView, SkiaIndic
if (indicatorView.SelectedIndicatorColor is not null)
{
handler.PlatformView.SelectedIndicatorColor = indicatorView.SelectedIndicatorColor.ToSKColor();
handler.PlatformView.SelectedIndicatorColor = indicatorView.SelectedIndicatorColor;
}
}

View File

@@ -364,7 +364,7 @@ public partial class NavigationPageHandler : ViewHandler<NavigationPage, SkiaNav
if (navigationPage.BarBackgroundColor is not null)
{
handler.PlatformView.BarBackgroundColor = navigationPage.BarBackgroundColor.ToSKColor();
handler.PlatformView.BarBackgroundColor = navigationPage.BarBackgroundColor;
}
}
@@ -374,7 +374,7 @@ public partial class NavigationPageHandler : ViewHandler<NavigationPage, SkiaNav
if (navigationPage.BarBackground is SolidColorBrush solidBrush)
{
handler.PlatformView.BarBackgroundColor = solidBrush.Color.ToSKColor();
handler.PlatformView.BarBackgroundColor = solidBrush.Color;
}
}
@@ -384,7 +384,7 @@ public partial class NavigationPageHandler : ViewHandler<NavigationPage, SkiaNav
if (navigationPage.BarTextColor is not null)
{
handler.PlatformView.BarTextColor = navigationPage.BarTextColor.ToSKColor();
handler.PlatformView.BarTextColor = navigationPage.BarTextColor;
}
}

View File

@@ -123,7 +123,7 @@ public partial class RefreshViewHandler : ViewHandler<RefreshView, SkiaRefreshVi
if (refreshView.RefreshColor is not null)
{
handler.PlatformView.RefreshColor = refreshView.RefreshColor.ToSKColor();
handler.PlatformView.RefreshColor = refreshView.RefreshColor;
}
}
@@ -145,7 +145,7 @@ public partial class RefreshViewHandler : ViewHandler<RefreshView, SkiaRefreshVi
if (refreshView.Background is SolidColorBrush solidBrush)
{
handler.PlatformView.RefreshBackgroundColor = solidBrush.Color.ToSKColor();
handler.PlatformView.RefreshBackgroundColor = solidBrush.Color;
}
}
}

View File

@@ -239,17 +239,17 @@ public partial class ShellHandler : ViewHandler<Shell, SkiaShell>
// Sync flyout colors
if (shell.FlyoutBackgroundColor is Color flyoutBgColor)
{
platformView.FlyoutBackgroundColor = flyoutBgColor.ToSKColor();
platformView.FlyoutBackgroundColor = flyoutBgColor;
}
else if (shell.FlyoutBackground is SolidColorBrush flyoutBrush)
{
platformView.FlyoutBackgroundColor = flyoutBrush.Color.ToSKColor();
platformView.FlyoutBackgroundColor = flyoutBrush.Color;
}
// Sync nav bar colors
if (shell.BackgroundColor is Color bgColor)
{
platformView.NavBarBackgroundColor = bgColor.ToSKColor();
platformView.NavBarBackgroundColor = bgColor;
}
}
@@ -293,7 +293,7 @@ public partial class ShellHandler : ViewHandler<Shell, SkiaShell>
if (shell.FlyoutBackgroundColor is Color color)
{
handler.PlatformView.FlyoutBackgroundColor = color.ToSKColor();
handler.PlatformView.FlyoutBackgroundColor = color;
}
}
@@ -303,7 +303,7 @@ public partial class ShellHandler : ViewHandler<Shell, SkiaShell>
if (shell.FlyoutBackground is SolidColorBrush solidBrush)
{
handler.PlatformView.FlyoutBackgroundColor = solidBrush.Color.ToSKColor();
handler.PlatformView.FlyoutBackgroundColor = solidBrush.Color;
}
}
@@ -313,7 +313,7 @@ public partial class ShellHandler : ViewHandler<Shell, SkiaShell>
if (shell.BackgroundColor is Color color)
{
handler.PlatformView.NavBarBackgroundColor = color.ToSKColor();
handler.PlatformView.NavBarBackgroundColor = color;
}
}

View File

@@ -126,7 +126,7 @@ public partial class TabbedPageHandler : ViewHandler<ITabbedView, SkiaTabbedPage
if (tabbedView is TabbedPage tabbedPage && tabbedPage.BarBackgroundColor is Color color)
{
handler.PlatformView.TabBarBackgroundColor = color.ToSKColor();
handler.PlatformView.TabBarBackgroundColor = color;
}
}
@@ -137,7 +137,7 @@ public partial class TabbedPageHandler : ViewHandler<ITabbedView, SkiaTabbedPage
if (tabbedView is TabbedPage tabbedPage && tabbedPage.BarTextColor is Color color)
{
// BarTextColor applies to unselected tabs
handler.PlatformView.UnselectedTabColor = color.ToSKColor();
handler.PlatformView.UnselectedTabColor = color;
}
}
@@ -147,8 +147,8 @@ public partial class TabbedPageHandler : ViewHandler<ITabbedView, SkiaTabbedPage
if (tabbedView is TabbedPage tabbedPage && tabbedPage.SelectedTabColor is Color color)
{
handler.PlatformView.SelectedTabColor = color.ToSKColor();
handler.PlatformView.IndicatorColor = color.ToSKColor();
handler.PlatformView.SelectedTabColor = color;
handler.PlatformView.IndicatorColor = color;
}
}
@@ -158,7 +158,7 @@ public partial class TabbedPageHandler : ViewHandler<ITabbedView, SkiaTabbedPage
if (tabbedView is TabbedPage tabbedPage && tabbedPage.UnselectedTabColor is Color color)
{
handler.PlatformView.UnselectedTabColor = color.ToSKColor();
handler.PlatformView.UnselectedTabColor = color;
}
}
}