streamdeck_oxide/
theme.rs1use resvg::tiny_skia::Color;
7
8#[derive(Clone, Copy)]
13pub struct Theme {
14 pub(crate) background: Color,
16 pub(crate) active_background: Color,
18 pub(crate) inactive_background: Color,
20 pub(crate) pressed_background: Color,
22 pub(crate) error_background: Color,
24 pub(crate) foreground_color: Color,
26 pub(crate) active_foreground_color: Color,
28}
29
30impl Default for Theme {
31 fn default() -> Self {
32 Self {
33 background: Color::from_rgba8(20, 20, 25, 255),
34 active_background: Color::from_rgba8(235, 51, 148, 255),
35 inactive_background: Color::from_rgba8(41, 41, 51, 255),
36 pressed_background: Color::from_rgba8(51, 217, 230, 255),
37 error_background: Color::from_rgba8(255, 89, 0, 255),
38 foreground_color: Color::from_rgba8(242, 242, 255, 255),
39 active_foreground_color: Color::from_rgba8(255, 255, 255, 255),
40 }
41 }
42}
43
44impl Theme {
45 pub fn new(
47 background: Color,
48 active_background: Color,
49 inactive_background: Color,
50 pressed_background: Color,
51 error_background: Color,
52 foreground_color: Color,
53 active_foreground_color: Color,
54 ) -> Self {
55 Self {
56 background,
57 active_background,
58 inactive_background,
59 pressed_background,
60 error_background,
61 foreground_color,
62 active_foreground_color,
63 }
64 }
65
66 pub fn dark() -> Self {
68 Self::default()
69 }
70
71 pub fn light() -> Self {
73 Self {
74 background: Color::from_rgba8(240, 240, 245, 255),
75 active_background: Color::from_rgba8(0, 122, 255, 255),
76 inactive_background: Color::from_rgba8(200, 200, 210, 255),
77 pressed_background: Color::from_rgba8(0, 180, 180, 255),
78 error_background: Color::from_rgba8(255, 59, 48, 255),
79 foreground_color: Color::from_rgba8(30, 30, 30, 255),
80 active_foreground_color: Color::from_rgba8(255, 255, 255, 255),
81 }
82 }
83}