From 044029fb669abce97671a1def2b7b1f26d2e81e5 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sun, 3 Mar 2024 15:57:03 +0100 Subject: [PATCH] config: add freestanding get_color and set_color functions --- jay-config/src/theme.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jay-config/src/theme.rs b/jay-config/src/theme.rs index ce221ffa..d953344f 100644 --- a/jay-config/src/theme.rs +++ b/jay-config/src/theme.rs @@ -258,6 +258,16 @@ pub mod colors { /// Default: `#23092c`. const 14 => ATTENTION_REQUESTED_BACKGROUND_COLOR, } + + /// Sets the color of GUI element. + pub fn set_color(element: Colorable, color: Color) { + get!().set_color(element, color); + } + + /// Gets the color of GUI element. + pub fn get_color(element: Colorable) -> Color { + get!(Color::BLACK).get_color(element) + } } /// Elements of the compositor whose size can be changed.