quickshell: blend status colours toward the theme accent

Fixed hues stayed legible but read as pasted on. Mix each 25% toward
base0D so they land in the wallpaper's family: err #e0525f -> #b86872,
ok #68c17c -> #5ebb88. statusHarmony is the one knob.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-01 13:42:59 +01:00
parent e2c413d997
commit 6f32d56c5b

View file

@ -282,16 +282,26 @@ in
// The one themed accent: active, focused, selected, filled.
readonly property color base0D: "#${c.base0D}"
// Status colours, deliberately NOT wallpaper-derived.
// stylix's base08-base0F all collapse to near-identical values
// on a monochrome wallpaper, which leaves "battery critical"
// and "battery low" the same colour. Status has to stay legible
// whatever is on the desktop, so these are fixed.
readonly property color err: "#e0525f" // critical: temp 85, batt 15, auth failed
readonly property color warn: "#e0a44b" // caution: temp 70, batt 30
readonly property color ok: "#68c17c" // connected / active / net down
readonly property color info: "#5aa6e0" // memory
readonly property color alt: "#b98ce0" // net up
// Status colours: fixed hues, pulled toward the theme.
// Sourcing these from stylix doesn't work base08-base0F all
// collapse to near-identical values on a monochrome wallpaper,
// which leaves "battery critical" and "battery low" the same
// colour. So the HUE is fixed and only the hue is: each one is
// then mixed toward base0D, which keeps red reading as red
// while landing it in the wallpaper's family instead of looking
// pasted on. Blending toward base0D and not toward the card
// keeps luminance roughly intact, so these stay legible as text
// on cardBg mixing into the background would sink them.
readonly property real statusHarmony: 0.25 // 0 = pure hue, 1 = pure accent
function harmonised(hex) {
let h = Qt.color(hex);
return Qt.tint(base0D, Qt.rgba(h.r, h.g, h.b, 1 - statusHarmony));
}
readonly property color err: harmonised("#e0525f") // critical: temp 85, batt 15, auth failed
readonly property color warn: harmonised("#e0a44b") // caution: temp 70, batt 30
readonly property color ok: harmonised("#68c17c") // connected / active / net down
readonly property color info: harmonised("#5aa6e0") // memory
readonly property color alt: harmonised("#b98ce0") // net up
readonly property color barBg: Qt.rgba(base00.r, base00.g, base00.b, 0.70)
// Card surfaces are translucent so the compositor's bar-layer