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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user