# settings/ui.nix — shared UI metrics. # # Single source of truth for corner rounding. Both the quickshell shell # (settings/quickshell.nix -> Theme.qml) and hyprland's window decoration # (settings/hyprland.nix) read `radius` from here, and every other rounding # value is derived from it, so this one number rescales the roundness of the # whole desktop — panels, cards, pills, hover rows and window corners. # # Derived values live next to their consumers: # Theme.radiusCard = radius - panelGap (concentric nesting, see Theme.qml) # Theme.radiusSmall = radius * 0.75 # Theme.radiusTiny = radius * 0.5 # hyprland decoration.rounding = radius { radius = 20; # ── Ink ladder ──────────────────────────────────────────────────────── # base05 is the wallpaper's ink. base04 and base03 are THAT colour mixed # toward the background, not stylix's own base03/base04: those are three # independent slots off the image and routinely land in unrelated hues — # on walls/wallhaven-k8dqr6 the raw ladder is red (base03), blue (base04) # and cream (base05). Mixing gives one colour at three strengths, which is # the same trick quickshell's Theme.base01/base02 already use for surfaces. # # Read by settings/quickshell.nix (Theme.qml), settings/theming.nix # (hypr.lua, applied at runtime) and settings/hyprland.nix (the build-time # fallback), so the shell frame and hyprland's window borders are the same # colour rather than two slots that happen to be near each other. inkMuted = 0.30; # base04 — secondary text, hyprland's active border inkFaint = 0.55; # base03 — disabled text, hyprland's inactive border # Mix two "rrggbb" strings. t = 0 keeps `a`, t = 1 lands on `b`. mixHex = a: b: t: let digits = "0123456789abcdef"; val = ch: { "0"=0; "1"=1; "2"=2; "3"=3; "4"=4; "5"=5; "6"=6; "7"=7; "8"=8; "9"=9; "a"=10; "b"=11; "c"=12; "d"=13; "e"=14; "f"=15; "A"=10; "B"=11; "C"=12; "D"=13; "E"=14; "F"=15; }.${ch}; byte = s: i: val (builtins.substring i 1 s) * 16 + val (builtins.substring (i + 1) 1 s); chan = i: let n = builtins.floor (byte a i + (byte b i - byte a i) * t + 0.5); hi = n / 16; in builtins.substring hi 1 digits + builtins.substring (n - hi * 16) 1 digits; in chan 0 + chan 2 + chan 4; }