maze_generator/prelude/
svgoptions.rs

1/// Options for generating SVG output
2#[derive(Debug)]
3pub struct SvgOptions {
4    /// Padding, default: 10
5    pub padding: i32,
6    /// Height in pixels - use None to derive a height based on the padding and number of cells in the maze
7    pub height: Option<i32>,
8    /// Marker size - start and end, default: 2
9    pub markersize: i32,
10    /// Start marker colour - either a named colour like 'red' or a hex string like '#FF0000', default: "red"
11    pub startcol: String,
12    /// Goal marker colour, default: "blue"
13    pub goalcol: String,
14    /// Stroke width, default: 4
15    pub strokewidth: i32,
16    /// Stroke  colour, default: "#000000" (black)
17    pub strokecol: String,
18}
19
20impl SvgOptions {
21    /// Create a default SvgOptions object
22    pub fn new() -> Self {
23        Default::default()
24    }
25}
26
27impl Default for SvgOptions {
28    fn default() -> Self {
29        SvgOptions {
30            height: None,
31            padding: 10,
32            markersize: 2,
33            startcol: String::from("red"),
34            goalcol: String::from("blue"),
35            strokewidth: 4,
36            strokecol: String::from("#000000"),
37        }
38    }
39}