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
use Rgba;
/// The `Config` struct holds configuration settings for the drawing canvas.
///
/// It allows you to specify various parameters such as the width and height of the canvas,
/// background color, optional border color, file paths for the canvas image and an optional font file.
///
/// # Examples
///
/// ```
/// use omage::{Config, Rgba};
///
/// // Create a new Config instance with specified settings
/// let config = Config::new(800, 600, Rgba([255, 255, 255, 255]), Some(Rgba([0, 0, 0, 255])),
/// "path/to/canvas/image.png", Some("path/to/font.ttf"));
/// ```
///
/// # Fields
///
/// - `width`: Width of the canvas.
/// - `height`: Height of the canvas.
/// - `color`: Background color of the canvas in Rgba format.
/// - `border`: Optional border color of the canvas in Rgba format.
/// - `path`: Path to the canvas image.
/// - `font_path`: Optional path to the font file.
///
/// # Methods
///
/// - `new`: Creates a new `Config` instance with the specified settings.
///
/// # Note
///
/// The `Config` struct is meant to be used to configure the canvas for drawing components,
/// and it provides a convenient way to customize various aspects of the canvas appearance.
///
/// ```