From f55b0c221cf1d901b3bc2301b8a08b4cc71b40d8 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Thu, 28 Nov 2024 19:06:08 +0100 Subject: substitute style const for UI rendering --- src/tui/colors.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/tui/colors.rs') diff --git a/src/tui/colors.rs b/src/tui/colors.rs index cbb0617..206ac92 100644 --- a/src/tui/colors.rs +++ b/src/tui/colors.rs @@ -17,11 +17,13 @@ #[derive(Debug, Clone)] pub struct AppColors { - main_text_color: u8, - highlight_text_color: u8, - entry_color: u8, - keyword_color: u8, - info_color: u8, + pub main_text_color: u8, + pub highlight_text_color: u8, + pub entry_color: u8, + pub keyword_color: u8, + pub info_color: u8, + pub confirm_color: u8, + pub warn_color: u8, } impl Default for AppColors { @@ -32,6 +34,8 @@ impl Default for AppColors { entry_color: 36, keyword_color: 101, info_color: 99, + confirm_color: 47, + warn_color: 124, } } } @@ -61,6 +65,14 @@ impl AppColors { self.info_color = index } + pub fn confirm_color(&mut self, index: u8) { + self.confirm_color = index + } + + pub fn warn_color(&mut self, index: u8) { + self.warn_color = index + } + /// Activates the default color scheme for light background terminals pub fn light_colors(&mut self) { self.main_text_color(235); -- cgit v1.2.3