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