Add an inward glow bleeding from the border over the window
New plugin:hyprchrome:glow_size (px, 0 = off) and glow_strength (0-1) bleed the border's own gradient inward past the window edge, over the window's own pixels. Off by default, so existing setups are unchanged. Drawn into the hole the ring's even-odd fill already leaves behind, from overlapping layers - one per px of depth - each covering the window edge inward to a progressively greater depth. Overlapping rather than abutting disjoint bands avoids an antialiasing seam at every shared edge; the cost is that a layer composites over every deeper one, so its alpha is solved outermost-inward from the target profile rather than being it. That profile is strength * (1 - d/glow)^2.2: steep off the window edge, easing into a tail that reaches zero tangentially so there's no ring where it stops. Corner handling, in order of how much it mattered: - Each layer's outer edge is the ring's inner boundary verbatim, chamfer vertices and all. Anything else detaches the glow from the frame and opens a sliver of unpainted window at each corner. - Each layer's inner edge - which is what the falloff's contours actually follow - is filleted in proportion to its own depth, so the glow reads as chamfered where it meets the frame and rounder as it fades inward. - Those inner edges also shrink their chamfer by (2-sqrt2) per px of inset. Insetting a chamfered rect while holding the chamfer constant moves the 45-degree face in by d*sqrt(2) rather than d, which had the glow running ~41% deeper at every corner than along the sides. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,14 @@ struct ChromeConfig {
|
||||
SP<GradientValue> activeColor;
|
||||
SP<GradientValue> inactiveColor;
|
||||
|
||||
// How far the border's glow bleeds inward past the window edge, over the
|
||||
// window's own pixels, in logical pixels. 0 disables the glow entirely.
|
||||
SP<IntValue> glowSize;
|
||||
|
||||
// Peak opacity of that glow, at the window edge, as a fraction of the
|
||||
// border color's own alpha.
|
||||
SP<FloatValue> glowStrength;
|
||||
|
||||
// Height of the title bar hanging off the floating top-border cutout, in
|
||||
// logical pixels.
|
||||
SP<IntValue> titlebarHeight;
|
||||
|
||||
Reference in New Issue
Block a user