1use crate::Pixel;
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub struct LineStyle {
6 pub color: Pixel,
8 pub width: usize,
10}
11
12impl LineStyle {
13 pub const fn new() -> Self {
15 Self {
16 color: Pixel::rgb(0, 0, 255),
17 width: 1,
18 }
19 }
20
21 pub const fn color(mut self, color: Pixel) -> Self {
23 self.color = color;
24 self
25 }
26
27 pub const fn width(mut self, width: usize) -> Self {
29 self.width = width;
30 self
31 }
32}
33
34impl Default for LineStyle {
35 fn default() -> Self {
36 Self::new()
37 }
38}
39
40#[derive(Clone, Copy, Debug, Eq, PartialEq)]
42pub struct MarkerStyle {
43 pub color: Pixel,
45 pub size: usize,
47}
48
49impl MarkerStyle {
50 pub const fn new() -> Self {
52 Self {
53 color: Pixel::rgb(255, 0, 0),
54 size: 1,
55 }
56 }
57
58 pub const fn color(mut self, color: Pixel) -> Self {
60 self.color = color;
61 self
62 }
63
64 pub const fn size(mut self, size: usize) -> Self {
66 self.size = size;
67 self
68 }
69}
70
71impl Default for MarkerStyle {
72 fn default() -> Self {
73 Self::new()
74 }
75}