From 7ead1202137c108c8ca7be8edeb7d6a74b5405df Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 16 Jun 2026 12:17:39 +0200 Subject: [PATCH] A1: scharfschalten DrawHoverSheen accent-tint (Variante A) --- .../Ui/StyleEngine/DrawListExtensions.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/HellionChat/Ui/StyleEngine/DrawListExtensions.cs b/HellionChat/Ui/StyleEngine/DrawListExtensions.cs index 1d0545f..1c0700c 100644 --- a/HellionChat/Ui/StyleEngine/DrawListExtensions.cs +++ b/HellionChat/Ui/StyleEngine/DrawListExtensions.cs @@ -12,9 +12,16 @@ namespace HellionChat.Ui.StyleEngine; // ABGR before delegating to ImDrawList. Hover-sheen state lives in a small // static dictionary keyed by constant strings — keep keys constant and // scope to static UI elements so the per-key footprint stays bounded. +// TEST-MIRROR: Util/ColourUtilTintTests.cs internal static class DrawListExtensions { private const float SheenDurationSeconds = 0.65f; + + // A1 accent-tint (Variante A): how far the white sweep is pulled toward + // the element's accent hue. Kept low so the sheen reads as a tinted + // highlight, not a saturated accent flash (effect level "subtle"). + private const float SheenTintStrength = 0.35f; + private static readonly Dictionary SheenStarts = new(); public static void DrawHoverSheen( @@ -46,7 +53,11 @@ internal static class DrawListExtensions var t = (float)(elapsed / SheenDurationSeconds); var alpha = (byte)Math.Round(0x40 * (1f - t)); - var sheenAbgr = ((uint)alpha << 24) | 0x00FFFFFFu; + // Tint the sweep toward the accent hue, then stamp the falloff alpha. + // accentRgba is RGBA; convert to ABGR FIRST or the draw-list swaps R/B. + var accentAbgr = ColourUtil.RgbaToAbgr(accentRgba); + var tintedRgb = ColourUtil.LerpTowardWhite(accentAbgr, SheenTintStrength) & 0x00FFFFFFu; + var sheenAbgr = ((uint)alpha << 24) | tintedRgb; var sweepX = min.X + (max.X - min.X) * t; dl.AddRectFilled( new Vector2(sweepX - 12f, min.Y), @@ -54,11 +65,6 @@ internal static class DrawListExtensions sheenAbgr, 2f ); - - // Accent currently unused — reserved for a tinted-sweep variant that - // tracks the element's accent hue. Keeping it in the signature so - // call-sites don't churn when the tinted path lands. - _ = accentRgba; } public static void DrawGlowBorder(