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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
use ;
use Environment;
use ;
use crate::;
/// Holds the template configuration:
/// - `source` path - file path to the template.
/// - `target` path - template build destination.
///
/// # Template syntax
///
/// In the template, you have access to a rich object-oriented color API.
///
/// ## Colors in template
///
/// You have access to all colors defined in the
/// [`Theme`](crate::theme::Theme). To access a color, you can add this
/// anywhere into your template file:
///
/// ```text
/// {{ color_name }}
/// ```
///
/// Where `color_name` should be replace by the color you want to use.
/// Available colors are:
///
/// - `primary`
/// - `secondary`
/// - `background`
/// - `surface`
/// - `border`
/// - `foreground`
/// - `muted`
/// - `success`
/// - `warning`
/// - `error`
///
/// ## Color methods
///
/// The following methods are available to manipulate the color object. They
/// can be chained together.
///
/// - `lighten(amount)`: lightens the color by adding a value to it.
/// - `brighten(amount)`: brightens the color relatively by a given multiplier.
/// - `darken(amount)`: darkens the color by adding a value to it.
/// - `dim(amount)`: dims the color relatively by a given multiplier.
/// - `saturate(amount)`: increases the saturation (chroma component) of the
/// color.
/// - `desaturate(amount)`: descreases the saturation (chroma component) of the
/// color.
///
/// ## Color formats
///
/// You can also convert the color into multiple text formats. Note that
/// after a color is formatted, it becomes a string and you cannot access the
/// menipulation methods anymore. You should use these last.
///
/// - `hex`: `#rrggbb` (default if no formatter is specified)
/// - `hexa(alpha)`: `#rrggbbaa`, where `alpha` is the provided float
/// (0.0 to 1.0).
/// - `rgb`: `r,g,b` format (e.g. `42,128,56`).
/// - `rgba(alpha)`: `r,g,b,a` format (e.g. `42,128,56,0.8`), where `alpha` is
/// the provided float (0.0 to 1.0).
/// - `strip`: hex without the leading `#` character - `rrggbb`.
/// - `r`, `g`, `b`: extracts the corresponding raw RGB color component.
///
/// # Example
///
/// ```text
/// /* Defaults to hex format. */
/// bg_color = "{{ background }}"
///
/// /* Chains methods before formatting. */
/// bg_hover = "rgb({{ background.lighten(0.1).rgb }})"
///
/// /* Creates transparent color. */
/// border = "rgba({{ primary.rgba(0.8) }})"
/// ```
/// Runs the given hook on the given directory.