feat(theme): per-app accent: pm gives window manifest accent before app runs (display ACCENT, refused after BUFFER); theme::with_accent keeps hue, shifts lightness until contrast passes, else theme accent; tally pink

This commit is contained in:
2026-10-28 13:40:38 +01:00
parent 6827e1455d
commit 2b82f052ae
14 changed files with 158 additions and 16 deletions

View File

@@ -31,6 +31,12 @@ pub fn open(display: CapSlot, name: &[u8]) -> Option<Opened> {
}
}
/// A launcher gives the window it opened its app's accent (`0xrrggbb`),
/// before the app runs; whether the display took it.
pub fn set_accent(window: CapSlot, rgb: u32) -> bool {
syscall::request(window, [w::ACCENT, rgb as usize, 0, 0]).is_ok_and(|r| r[0] == w::OK)
}
/// Closes `window`: every copy of it, and its buffer, stop working.
pub fn close(window: CapSlot) {
let _ = syscall::request(window, [w::CLOSE, 0, 0, 0]);