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
use color::{Color, hsl, hsla, rgb, rgba};
#[derive(Copy, Clone)]
pub enum Bordering {
Border(f64, Color),
NoBorder,
}
pub trait Borderable: Sized {
fn border(self, width: f64) -> Self;
fn border_color(self, color: Color) -> Self;
fn border_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self {
self.border_color(rgba(r, g, b, a))
}
fn border_rgb(self, r: f32, g: f32, b: f32) -> Self {
self.border_color(rgb(r, g, b))
}
fn border_hsla(self, h: f32, s: f32, l: f32, a: f32) -> Self {
self.border_color(hsla(h, s, l, a))
}
fn border_hsl(self, h: f32, s: f32, l: f32) -> Self {
self.border_color(hsl(h, s, l))
}
}