1use crate::color::Color;
7
8#[derive(Clone, Debug, PartialEq)]
10pub struct Theme {
11 pub name: String,
13 pub filename: Option<String>,
15 pub background: Color,
17 pub grid: Color,
19 pub selection: Color,
21 pub highlight: Color,
23 pub entity: Color,
25 pub outline: Color,
27 pub active: Color,
29 pub inactive: Color,
31 pub measure: Color,
33 pub snap_indicator: Color,
35 pub guide: Color,
37}
38
39impl Theme {
40 pub fn dark() -> Self {
42 Self {
43 name: "default/dark".into(),
44 filename: None,
45 background: Color::rgb(0.1, 0.1, 0.1),
46 grid: Color::rgb(0.2, 0.2, 0.2),
47 selection: Color::rgb(1.0, 0.6, 0.0),
48 highlight: Color::rgb(1.0, 1.0, 0.0),
49 entity: Color::rgba(0.9, 0.9, 0.9, 0.7),
50 outline: Color::rgb(0.1, 0.1, 0.1),
51 active: Color::rgb(0.8, 0.8, 0.8),
52 inactive: Color::rgb(0.4, 0.4, 0.4),
53 measure: Color::rgb(0.0, 0.8, 0.8),
54 snap_indicator: Color::rgb(0.0, 1.0, 1.0),
55 guide: Color::rgb(0.6, 0.6, 0.6),
56 }
57 }
58
59 pub fn light() -> Self {
61 Self {
62 name: "default/light".into(),
63 filename: None,
64 background: Color::rgb(1.0, 1.0, 1.0),
65 grid: Color::rgb(0.85, 0.85, 0.85),
66 selection: Color::rgb(0.0, 0.4, 0.8),
67 highlight: Color::rgb(1.0, 0.6, 0.0),
68 entity: Color::rgba(0.7, 0.7, 0.7, 0.7),
69 outline: Color::rgb(0.1, 0.1, 0.1),
70 active: Color::rgb(0.2, 0.2, 0.2),
71 inactive: Color::rgb(0.8, 0.8, 0.8),
72 measure: Color::rgb(0.0, 0.8, 0.8),
73 snap_indicator: Color::rgb(0.0, 0.8, 0.8),
74 guide: Color::rgb(0.6, 0.6, 0.6),
75 }
76 }
77}
78
79impl Default for Theme {
80 fn default() -> Self {
81 Self::light()
82 }
83}