1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#[derive(Default)]
pub struct Settings {
    pub style: Style,
}

pub struct LayerStyle {
    pub color_background: String,
    pub color_label: String,
    pub color_edge: String,
    pub color_edge_slot: String,
}

pub struct Style {
    pub fontname: String,
    pub fontsize: f32,
    pub color_background: String,
    pub color_text: String,
    pub color_typename: String,
    pub layers: Vec<LayerStyle>,
    pub color_node: String,
    pub node_style: String,
}
impl Style {
    pub fn light() -> Self {
        Style {
            fontname: "Helvetica".into(),
            fontsize: 14.0,
            color_text: "black".into(),
            color_typename: "red".into(),
            color_background: "white".into(),
            layers: vec![
                LayerStyle {
                    color_background: "#c4d0ed".into(),
                    color_edge: "black".into(),
                    color_edge_slot: "blue".into(),
                    color_label: "black".into(),
                },
                LayerStyle {
                    color_background: "#e4e9f5".into(),
                    color_label: "black".into(),
                    color_edge: "black".into(),
                    color_edge_slot: "blue".into(),
                },
            ],
            color_node: "black".into(),
            node_style: "rounded".into(),
        }
    }

    pub fn dark_github() -> Self {
        Style {
            fontname: "Helvetica".into(),
            fontsize: 14.0,
            color_text: "white".into(),
            color_typename: "red".into(),
            color_background: "#0d1117".into(),
            layers: vec![
                LayerStyle {
                    color_background: "#6f90ad".into(),
                    color_label: "black".into(),
                    color_edge: "white".into(),
                    color_edge_slot: "#715ed6".into(),
                },
                LayerStyle {
                    color_background: "#343a42".into(),
                    color_label: "white".into(),
                    color_edge: "white".into(),
                    color_edge_slot: "#a79be6".into(),
                },
            ],
            color_node: "white".into(),
            node_style: "rounded".into(),
        }
    }

    pub fn dark_discord() -> Self {
        Style {
            fontname: "Helvetica".into(),
            fontsize: 14.0,
            color_text: "white".into(),
            color_typename: "red".into(),
            color_background: "#35393F".into(),
            layers: vec![
                LayerStyle {
                    color_background: "#6f90ad".into(),
                    color_label: "black".into(),
                    color_edge: "white".into(),
                    color_edge_slot: "#a79be6".into(),
                },
                LayerStyle {
                    color_background: "#5e6570".into(),
                    color_label: "white".into(),
                    color_edge: "white".into(),
                    color_edge_slot: "#a79be6".into(),
                },
            ],
            color_node: "#99aab5".into(),
            node_style: "rounded".into(),
        }
    }
}

impl Default for Style {
    fn default() -> Self {
        Style::dark_github()
    }
}