From 31eb8c36430308b3821c14414d1f72b6b61a0222 Mon Sep 17 00:00:00 2001 From: Clement Sepulchre Date: Wed, 9 Oct 2024 12:09:33 +0200 Subject: [PATCH] gradient by default --- SukiUI.Demo/SukiUIDemoViewModel.cs | 2 +- SukiUI/Content/Shaders/Background/gradient.sksl | 6 +++--- SukiUI/Controls/SukiBackground.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SukiUI.Demo/SukiUIDemoViewModel.cs b/SukiUI.Demo/SukiUIDemoViewModel.cs index 3ba258b3c..bd57beb6b 100644 --- a/SukiUI.Demo/SukiUIDemoViewModel.cs +++ b/SukiUI.Demo/SukiUIDemoViewModel.cs @@ -34,7 +34,7 @@ public partial class SukiUIDemoViewModel : ObservableObject [ObservableProperty] private DemoPageBase? _activePage; [ObservableProperty] private bool _windowLocked; [ObservableProperty] private bool _titleBarVisible = true; - [ObservableProperty] private SukiBackgroundStyle _backgroundStyle = SukiBackgroundStyle.Bubble; + [ObservableProperty] private SukiBackgroundStyle _backgroundStyle = SukiBackgroundStyle.Gradient; [ObservableProperty] private bool _animationsEnabled; [ObservableProperty] private string? _customShaderFile; [ObservableProperty] private bool _transitionsEnabled; diff --git a/SukiUI/Content/Shaders/Background/gradient.sksl b/SukiUI/Content/Shaders/Background/gradient.sksl index 0daeb7dd5..531107cba 100644 --- a/SukiUI/Content/Shaders/Background/gradient.sksl +++ b/SukiUI/Content/Shaders/Background/gradient.sksl @@ -66,14 +66,14 @@ vec4 main(vec2 fragCoord) { float opacityLayer2 = 0.85 - (iDark / 2); - float iPrimaryOpacity = 0.2; // Exemple de nouvelle opacité pour iPrimary + float iPrimaryOpacity = 1.5; // Exemple de nouvelle opacité pour iPrimary if (iDark == 1) { iPrimaryOpacity = 0.4; } vec3 iPrimaryWithOpacity = iPrimary * iPrimaryOpacity; - float iAccentOpacity = 1; + float iAccentOpacity = -1.05; if (iDark == 1) { iAccentOpacity = 2; } @@ -89,7 +89,7 @@ vec4 main(vec2 fragCoord) { vec3 col; if (iDark == 0) { - col = blendOverlay(iBase, finalComp); + col = blendOverlay(iBase * 1.02, finalComp); } else { col = blendOverlayDark(iBase, finalComp); } diff --git a/SukiUI/Controls/SukiBackground.cs b/SukiUI/Controls/SukiBackground.cs index e8bdaa681..6a79f8d19 100644 --- a/SukiUI/Controls/SukiBackground.cs +++ b/SukiUI/Controls/SukiBackground.cs @@ -13,7 +13,7 @@ public class SukiBackground : Control { public static readonly StyledProperty StyleProperty = AvaloniaProperty.Register(nameof(Style), - defaultValue: SukiBackgroundStyle.Bubble); + defaultValue: SukiBackgroundStyle.Gradient); /// /// Which of the default background styles to use - DEFAULT: Gradient