launcher: an accent colour and a picture behind Home

Settings > Launcher picks an accent (violet by default, blue, teal, green, amber, red, pink)
and the player's own picture behind Home. An accent turns the violet tokens to its hue and
adjusts their lightness until text on the Play button and the accent on every background read
as well as the violet's. The picture is checked, copied under a name of its hash and shown
cropped under the banner's veils. CLI: settings accent NAME, settings background PATH|default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-27 05:07:38 +01:00
parent b3709b9766
commit 8beaa57331
12 changed files with 577 additions and 31 deletions
+8 -14
View File
@@ -4,6 +4,7 @@
//! Mono for text (all bundled, SIL Open Font License).
use gpui::{rgb, Hsla, WindowAppearance};
use horizon_launcher::backend::Appearance;
use horizon_launcher::themes::Accent;
use horizon_theme as tokens;
use std::time::Duration;
@@ -91,25 +92,18 @@ pub fn pinned_dark(choice: Appearance) -> Option<bool> {
impl Theme {
/// The pinned look (`pinned_dark`: dark unless the player picked another), the system's when
/// they asked to follow it.
pub fn for_appearance(choice: Appearance, system: WindowAppearance) -> Self {
/// they asked to follow it, in the player's accent.
pub fn for_appearance(choice: Appearance, accent: Accent, system: WindowAppearance) -> Self {
let system_dark = !matches!(
system,
WindowAppearance::Light | WindowAppearance::VibrantLight
);
if pinned_dark(choice).unwrap_or(system_dark) {
Self::dark()
let dark = pinned_dark(choice).unwrap_or(system_dark);
Self::from(accent.apply(if dark {
tokens::BLOCKS_DARK
} else {
Self::light()
}
}
pub fn dark() -> Self {
Self::from(tokens::BLOCKS_DARK)
}
pub fn light() -> Self {
Self::from(tokens::BLOCKS_LIGHT)
tokens::BLOCKS_LIGHT
}))
}
fn from(p: tokens::Blocks) -> Self {