ringkernel_txmon/gui/
theme.rs1use iced::Color;
4
5pub mod colors {
7 use super::*;
8
9 pub const BACKGROUND: Color = Color::from_rgb(0.08, 0.09, 0.11);
11
12 pub const SURFACE: Color = Color::from_rgb(0.12, 0.13, 0.16);
14
15 pub const SURFACE_BRIGHT: Color = Color::from_rgb(0.18, 0.19, 0.22);
17
18 pub const BORDER: Color = Color::from_rgb(0.25, 0.26, 0.30);
20
21 pub const TEXT_PRIMARY: Color = Color::from_rgb(0.92, 0.92, 0.94);
23
24 pub const TEXT_SECONDARY: Color = Color::from_rgb(0.6, 0.62, 0.66);
26
27 pub const TEXT_DISABLED: Color = Color::from_rgb(0.4, 0.42, 0.46);
29
30 pub const ACCENT_BLUE: Color = Color::from_rgb(0.2, 0.5, 0.9);
32
33 pub const ACCENT_GREEN: Color = Color::from_rgb(0.2, 0.8, 0.4);
35
36 pub const ACCENT_ORANGE: Color = Color::from_rgb(0.9, 0.5, 0.1);
38
39 pub const ALERT_CRITICAL: Color = Color::from_rgb(0.9, 0.2, 0.2);
41
42 pub const ALERT_HIGH: Color = Color::from_rgb(0.9, 0.5, 0.1);
44
45 pub const ALERT_MEDIUM: Color = Color::from_rgb(0.9, 0.8, 0.2);
47
48 pub const ALERT_LOW: Color = Color::from_rgb(0.4, 0.7, 0.4);
50
51 pub const MONEY_POSITIVE: Color = Color::from_rgb(0.2, 0.8, 0.4);
53
54 pub const MONEY_NEGATIVE: Color = Color::from_rgb(0.9, 0.3, 0.3);
56
57 pub const STATE_RUNNING: Color = Color::from_rgb(0.2, 0.8, 0.4);
59
60 pub const STATE_PAUSED: Color = Color::from_rgb(0.9, 0.8, 0.2);
62
63 pub const STATE_STOPPED: Color = Color::from_rgb(0.6, 0.62, 0.66);
65}
66
67pub fn severity_color(severity: crate::types::AlertSeverity) -> Color {
69 match severity {
70 crate::types::AlertSeverity::Low => colors::ALERT_LOW,
71 crate::types::AlertSeverity::Medium => colors::ALERT_MEDIUM,
72 crate::types::AlertSeverity::High => colors::ALERT_HIGH,
73 crate::types::AlertSeverity::Critical => colors::ALERT_CRITICAL,
74 }
75}