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:
@@ -33,6 +33,16 @@ struct GlobalState {
|
||||
"plugin:hyprchrome:inactive_color",
|
||||
"Color (or gradient) of the border on unfocused windows, used when follow_hyprland_border_color is false",
|
||||
CHyprColor{RGBAToARGB(0x6C6C6CFF)}),
|
||||
.glowSize = makeShared<IntValue>(
|
||||
"plugin:hyprchrome:glow_size",
|
||||
"How far the border's glow bleeds inward over the window, in pixels (0 disables it)",
|
||||
0,
|
||||
IntValueOptions{.min = 0}),
|
||||
.glowStrength = makeShared<FloatValue>(
|
||||
"plugin:hyprchrome:glow_strength",
|
||||
"Peak opacity of the inward glow at the window edge, 0-1",
|
||||
0.35F,
|
||||
FloatValueOptions{.min = 0.F, .max = 1.F}),
|
||||
.titlebarHeight = makeShared<IntValue>(
|
||||
"plugin:hyprchrome:titlebar_height",
|
||||
"Height of the title bar hanging off the floating top-border cutout, in pixels",
|
||||
@@ -52,6 +62,8 @@ struct GlobalState {
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.followHyprlandBorderColor);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.activeColor);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.inactiveColor);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.glowSize);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.glowStrength);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.titlebarHeight);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.titlebarTextSize);
|
||||
HyprlandAPI::addConfigValueV2(plugin, config.titlebarFont);
|
||||
|
||||
Reference in New Issue
Block a user