feat: complete quickshell redesign
This commit is contained in:
1 parent
1eb0820083
commit
0ff727898a
25 files changed
+1410
-401
No files matched your search
@@ -13,6 +13,13 @@ def hex-byte [] {
|
||||
$"0x($in)" | into int
|
||||
}
|
||||
|
||||
def to-hex-byte [n: int] {
|
||||
let digits = "0123456789abcdef"
|
||||
let hi = ($n // 16)
|
||||
let lo = ($n mod 16)
|
||||
$"($digits | str substring $hi..$hi)($digits | str substring $lo..$lo)"
|
||||
}
|
||||
|
||||
def rgb-to-hsl [rgb: record<r: int, g: int, b: int>] {
|
||||
let r = $rgb.r / 255
|
||||
let g = $rgb.g / 255
|
||||
@@ -130,9 +137,25 @@ def pick-accents [flavor: string, swatches: list, want: int, min_sep: float] {
|
||||
$chosen_names
|
||||
}
|
||||
|
||||
def container-tint [hex: string] {
|
||||
# accent-tinted, ~14% opacity - a soft fill for badges/containers
|
||||
$"#24($hex | str substring 1..)"
|
||||
def blend-hex [a: string, b: string, ratio: float] {
|
||||
# Opaque RGB interpolation - neo-brutalist surfaces are solid blocks, never
|
||||
# alpha blends, so "muted container" colors are baked as real flat hex.
|
||||
let ar = ($a | str substring 1..2 | hex-byte)
|
||||
let ag = ($a | str substring 3..4 | hex-byte)
|
||||
let ab = ($a | str substring 5..6 | hex-byte)
|
||||
let br = ($b | str substring 1..2 | hex-byte)
|
||||
let bg = ($b | str substring 3..4 | hex-byte)
|
||||
let bb = ($b | str substring 5..6 | hex-byte)
|
||||
let mix = {|x, y| (($x * (1 - $ratio)) + ($y * $ratio)) | math round | into int }
|
||||
let r = (to-hex-byte (do $mix $ar $br))
|
||||
let g = (to-hex-byte (do $mix $ag $bg))
|
||||
let b2 = (to-hex-byte (do $mix $ab $bb))
|
||||
$"#($r)($g)($b2)"
|
||||
}
|
||||
|
||||
def container-tint [base: string, accent: string] {
|
||||
# Opaque muted tile: ~30% accent blended into the base surface, no alpha.
|
||||
blend-hex $base $accent 0.3
|
||||
}
|
||||
|
||||
def write-theme-colors [flavor: string, accent_names: list] {
|
||||
@@ -141,37 +164,39 @@ def write-theme-colors [flavor: string, accent_names: list] {
|
||||
let secondary = ($p.accents | get $accent_names.1)
|
||||
let tertiary = ($p.accents | get $accent_names.2)
|
||||
let info = $p.accents.sapphire
|
||||
let border = $"#1a($primary | str substring 1..)" # accent-tinted, ~10% opacity
|
||||
|
||||
let colors = [
|
||||
$" property color background: \"#e6($p.crust | str substring 1..)\""
|
||||
$" property color surface: \"#cc($p.mantle | str substring 1..)\""
|
||||
$" property color surfaceHover: \"#f2($p.surface0 | str substring 1..)\""
|
||||
$" property color overlay: \"#60($p.crust | str substring 1..)\""
|
||||
$" property color background: \"($p.base)\""
|
||||
$" property color surface: \"($p.mantle)\""
|
||||
$" property color surfaceHover: \"($p.surface0)\""
|
||||
$" property color overlay: \"#cc($p.crust | str substring 1..)\""
|
||||
""
|
||||
$" property color crust: \"($p.crust)\""
|
||||
$" property color outlineVariant: \"($p.surface1)\""
|
||||
""
|
||||
$" property color primary: \"($primary)\""
|
||||
$" property color secondary: \"($secondary)\""
|
||||
$" property color tertiary: \"($tertiary)\""
|
||||
$" property color accent: \"($primary)\""
|
||||
""
|
||||
$" property color primaryContainer: \"(container-tint $primary)\""
|
||||
$" property color secondaryContainer: \"(container-tint $secondary)\""
|
||||
$" property color tertiaryContainer: \"(container-tint $tertiary)\""
|
||||
$" property color primaryContainer: \"(container-tint $p.surface0 $primary)\""
|
||||
$" property color secondaryContainer: \"(container-tint $p.surface0 $secondary)\""
|
||||
$" property color tertiaryContainer: \"(container-tint $p.surface0 $tertiary)\""
|
||||
""
|
||||
$" property color alert: \"($p.red)\""
|
||||
$" property color alertContainer: \"(container-tint $p.red)\""
|
||||
$" property color alertContainer: \"(container-tint $p.surface0 $p.red)\""
|
||||
$" property color success: \"($p.green)\""
|
||||
$" property color successContainer: \"(container-tint $p.green)\""
|
||||
$" property color successContainer: \"(container-tint $p.surface0 $p.green)\""
|
||||
$" property color warning: \"($p.yellow)\""
|
||||
$" property color warningContainer: \"(container-tint $p.yellow)\""
|
||||
$" property color warningContainer: \"(container-tint $p.surface0 $p.yellow)\""
|
||||
$" property color info: \"($info)\""
|
||||
$" property color infoContainer: \"(container-tint $info)\""
|
||||
$" property color infoContainer: \"(container-tint $p.surface0 $info)\""
|
||||
""
|
||||
$" property color text: \"($p.text)\""
|
||||
$" property color textMuted: \"($p.subtext0)\""
|
||||
$" property color textOnAccent: \"#e6($p.crust | str substring 1..)\""
|
||||
$" property color textOnAccent: \"($p.crust)\""
|
||||
""
|
||||
$" property color border: \"($border)\""
|
||||
$" property color border: \"($p.crust)\""
|
||||
]
|
||||
|
||||
let theme_path = $"($env.HOME)/.config/quickshell/components/Shared/Theme.qml"
|
||||
|
||||
Reference in new issue
Block a user