1use densa_core::Color;
2
3#[derive(Debug, Clone, PartialEq)]
6#[non_exhaustive]
7pub struct Theme {
8 pub background: Color,
10 pub surface: Color,
12 pub raised: Color,
14 pub hover: Color,
16 pub pressed: Color,
18 pub border: Color,
20 pub text: Color,
22 pub text_dim: Color,
24 pub accent: Color,
26 pub on_accent: Color,
28 pub selection: Color,
30 pub focus: Color,
32 pub font_size: f32,
34 pub spacing: f32,
36}
37
38impl Theme {
39 pub fn dark() -> Self {
41 Self {
42 background: Color::srgb(0x0B1220),
43 surface: Color::srgb(0x111A2B),
44 raised: Color::srgb(0x1A2540),
45 hover: Color::srgb(0x22304A),
46 pressed: Color::srgb(0x2A3A5C),
47 border: Color::srgb(0x22304A),
48 text: Color::srgb(0xE6EDF7),
49 text_dim: Color::srgb(0x9AA8BE),
50 accent: Color::srgb(0x2F5BEA),
51 on_accent: Color::WHITE,
52 selection: Color::srgb(0x2F5BEA).with_alpha(0.45),
53 focus: Color::srgb(0x6B9BFF),
54 font_size: 13.0,
55 spacing: 4.0,
56 }
57 }
58
59 pub fn light() -> Self {
61 Self {
62 background: Color::srgb(0xF4F6FA),
63 surface: Color::srgb(0xFFFFFF),
64 raised: Color::srgb(0xFFFFFF),
65 hover: Color::srgb(0xEEF2F8),
66 pressed: Color::srgb(0xE2E8F2),
67 border: Color::srgb(0xD5DCE6),
68 text: Color::srgb(0x0B1220),
69 text_dim: Color::srgb(0x5B6B82),
70 accent: Color::srgb(0x2F5BEA),
71 on_accent: Color::WHITE,
72 selection: Color::srgb(0x2F5BEA).with_alpha(0.25),
73 focus: Color::srgb(0x2F5BEA),
74 font_size: 13.0,
75 spacing: 4.0,
76 }
77 }
78}
79
80impl Default for Theme {
81 fn default() -> Self {
83 Self::dark()
84 }
85}