Files
qbz/crates/qbz-qt/qml/theme/AmbientAccent.qml
T
vicrodh 1a4797085a feat(qt): derive immersive accents from the album palette
New theme/AmbientAccent helper: reads ambientPrimary (the album's own
dominant hue) and lifts its lightness into a legible band. The shell's
ambientAccent is the +180-degree complement, which is how a deep-blue
cover ended up with orange chrome; accents now stay in the album palette.
ImmersiveTrackMeta tints its Now Playing indicator with it instead of the
theme accent (no contrast guarantee over ambient), opts its badge into
overAmbient and shadows its text rows for light covers.

cc
2026-08-31 15:03:14 -06:00

36 lines
1.5 KiB
QML

// AmbientAccent — the album-palette accent LIFTED for legibility over the
// ambient/immersive backdrop (2026-08-31 immersive visual cleanup).
//
// Why this exists: `QbzShell.ambientAccent` is the +180° COMPLEMENT of the
// album's dominant hue (ambient_qt.rs lyrics_accent_color), and the
// ReactiveSplitPanel used to derive yet another complement locally — which is
// how a deep-blue cover ended up with an ORANGE waveform and seek bar. The
// owner's rule: chrome accents must come from the album's OWN palette, with
// enough contrast to survive the ambient wash.
//
// So this reads `ambientPrimary` (the dominant album hue itself, S 0.85
// L 0.58 for chromatic covers) and lifts its lightness into a band that reads
// over both the dark immersive glass and a colorful ambient field, keeping
// the hue. Achromatic covers (hslHue == -1) degrade to a plain light grey
// instead of inventing a hue.
//
// Usage (instantiate like QbzTheme, read `.value`):
// AmbientAccent { id: ambientAccent }
// color: ambientAccent.value
import QtQuick
import com.blitzfc.qbz
QtObject {
id: root
readonly property color source: QbzShell.ambientPrimary
readonly property color value: root.source.hslSaturation < 0.05
? Qt.rgba(1.0, 1.0, 1.0, 0.92)
: Qt.hsla(Math.max(0.0, root.source.hslHue),
Math.min(0.85, Math.max(0.45, root.source.hslSaturation)),
Math.min(0.80, Math.max(0.66, root.source.hslLightness)),
1.0)
}