wplot/sys/
stroke_brush.rs1pub( crate ) mod private
3{
4  use crate::protected::*;
5
6  #[ derive( Debug, Clone ) ]
8  pub struct StrokeBrush
9  {
10    pub( crate ) id : Id,
11    pub( crate ) color : Rgba,
12    pub( crate ) width : f32,
13  }
14
15  impl Default for StrokeBrush
16  {
17    fn default() -> Self
18    {
19      let id = Id::new::< Self >();
20      let color = Default::default();
21      let width = 1.0;
22      Self { id, color, width }
23    }
24  }
25
26  impl StrokeBrush
27  {
28
29    pub fn new() -> Self
31    {
32      Default::default()
33    }
34
35    #[ inline ]
37    pub fn color< Color >( mut self, val : Color ) -> Self
38    where
39      Color : RgbaInterface< f32 >,
40    {
41      self.color = val.into_rgba();
42      self
43    }
44
45    #[ inline ]
47    pub fn width( mut self, val : f32 ) -> Self
48    {
49      self.width = val;
50      self
51    }
52
53  }
54
55  impl HasIdInterface for StrokeBrush
56  {
57    #[ inline ]
58    fn id( &self ) -> Id
59    {
60      self.id
61    }
62  }
63
64}
65
66crate::mod_interface!
67{
68  exposed use StrokeBrush;
69
70  layer changer;
72  layer change_new;
74  layer change_color;
76  layer change_width;
78
79}