A2: name Sheen tuning knobs + SmoothStep crossfade easing
This commit is contained in:
@@ -522,7 +522,10 @@ public sealed class ThemeRegistry
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
var t = (float)(now - _crossfadeStartTickMs) / CrossfadeDurationMs;
|
var t = (float)(now - _crossfadeStartTickMs) / CrossfadeDurationMs;
|
||||||
snapshot = ThemeAbgrCacheLerp.Lerp(_previousAbgrSnapshot.Value, _active.AbgrCache, t);
|
// A2: SmoothStep easing so the fade eases in/out instead of a
|
||||||
|
// linear ramp. MUST stay in lockstep with TryGetActiveCrossfade (K8).
|
||||||
|
var te = t * t * (3f - 2f * t);
|
||||||
|
snapshot = ThemeAbgrCacheLerp.Lerp(_previousAbgrSnapshot.Value, _active.AbgrCache, te);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -548,7 +551,9 @@ public sealed class ThemeRegistry
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var t = (float)elapsed / CrossfadeDurationMs;
|
var t = (float)elapsed / CrossfadeDurationMs;
|
||||||
lerped = ThemeAbgrCacheLerp.Lerp(_previousAbgrSnapshot.Value, _active.AbgrCache, t);
|
// A2: SmoothStep easing -- keep identical to ArmCrossfade (K8).
|
||||||
|
var te = t * t * (3f - 2f * t);
|
||||||
|
lerped = ThemeAbgrCacheLerp.Lerp(_previousAbgrSnapshot.Value, _active.AbgrCache, te);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ internal static class DrawListExtensions
|
|||||||
// highlight, not a saturated accent flash (effect level "subtle").
|
// highlight, not a saturated accent flash (effect level "subtle").
|
||||||
private const float SheenTintStrength = 0.35f;
|
private const float SheenTintStrength = 0.35f;
|
||||||
|
|
||||||
|
// A2 tuning knob: peak alpha at t=0, fading linearly to 0 over the sweep.
|
||||||
|
private const byte SheenPeakAlpha = 0x40;
|
||||||
|
|
||||||
private static readonly Dictionary<string, DateTime> SheenStarts = new();
|
private static readonly Dictionary<string, DateTime> SheenStarts = new();
|
||||||
|
|
||||||
// Test-observability hook for HoverSheenAllocStep: lets the self-test
|
// Test-observability hook for HoverSheenAllocStep: lets the self-test
|
||||||
@@ -57,7 +60,7 @@ internal static class DrawListExtensions
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var t = (float)(elapsed / SheenDurationSeconds);
|
var t = (float)(elapsed / SheenDurationSeconds);
|
||||||
var alpha = (byte)Math.Round(0x40 * (1f - t));
|
var alpha = (byte)Math.Round(SheenPeakAlpha * (1f - t));
|
||||||
// Tint the sweep toward the accent hue, then stamp the falloff alpha.
|
// 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.
|
// accentRgba is RGBA; convert to ABGR FIRST or the draw-list swaps R/B.
|
||||||
var accentAbgr = ColourUtil.RgbaToAbgr(accentRgba);
|
var accentAbgr = ColourUtil.RgbaToAbgr(accentRgba);
|
||||||
|
|||||||
Reference in New Issue
Block a user