simple_colors/macros/
bg.rs1#[macro_export]
2macro_rules! bg {
13 ( $str: tt ) => ({
14 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
15 &format!("\x1b[7m{}\x1b[0m", $str)
16 });
17 ( $other: expr) => ({
19 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
20 &format!("\x1b[7m{}\x1b[0m", $other)
21 })
22}
23
24#[macro_export]
25macro_rules! bg_black {
35 ( $str: tt ) => ({
36 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
37 &format!("\x1b[40m{}\x1b[0m", $str)
38 });
39 ( $other: expr) => ({
41 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
42 &format!("\x1b[40m{}\x1b[0m", $other)
43 })
44}
45
46#[macro_export]
47macro_rules! bg_red {
48 ( $str: tt ) => ({
49 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
50 &format!("\x1b[41m{}\x1b[0m", $str)
51 });
52 ( $other: expr) => ({
54 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
55 &format!("\x1b[41m{}\x1b[0m", $other)
56 })
57}
58
59#[macro_export]
60macro_rules! bg_green {
61 ( $str: tt ) => ({
62 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
63 &format!("\x1b[42m{}\x1b[0m", $str)
64 });
65 ( $other: expr) => ({
67 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
68 &format!("\x1b[42m{}\x1b[0m", $other)
69 })
70}
71
72#[macro_export]
73macro_rules! bg_yellow {
74 ( $str: tt ) => ({
75 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
76 &format!("\x1b[43m{}\x1b[0m", $str)
77 });
78 ( $other: expr) => ({
80 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
81 &format!("\x1b[43m{}\x1b[0m", $other)
82 })
83}
84
85#[macro_export]
86macro_rules! bg_blue {
88 ( $str: tt ) => ({
89 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
90 &format!("\x1b[44m{}\x1b[0m", $str)
91 });
92 ( $other: expr) => ({
94 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
95 &format!("\x1b[44m{}\x1b[0m", $other)
96 })
97}
98
99#[macro_export]
100macro_rules! bg_magenta {
101 ( $str: tt ) => ({
102 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
103 &format!("\x1b[45m{}\x1b[0m", $str)
104 });
105 ( $other: expr) => ({
107 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
108 &format!("\x1b[45m{}\x1b[0m", $other)
109 })
110}
111
112#[macro_export]
113macro_rules! bg_cyan {
114 ( $str: tt ) => ({
115 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
116 &format!("\x1b[46m{}\x1b[0m", $str)
117 });
118 ( $other: expr) => ({
120 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
121 &format!("\x1b[46m{}\x1b[0m", $other)
122 })
123}
124
125#[macro_export]
126macro_rules! bg_light_gray {
127 ( $str: tt ) => ({
128 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
129 &format!("\x1b[47m{}\x1b[0m", $str)
130 });
131 ( $other: expr) => ({
133 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
134 &format!("\x1b[47m{}\x1b[0m", $other)
135 })
136}
137
138#[macro_export]
139macro_rules! bg_dark_gray {
140 ( $str: tt ) => ({
141 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
142 &format!("\x1b[100m{}\x1b[0m", $str)
143 });
144 ( $other: expr) => ({
146 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
147 &format!("\x1b[100m{}\x1b[0m", $other)
148 })
149}
150
151#[macro_export]
152macro_rules! bg_light_red {
153 ( $str: tt ) => ({
154 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
155 &format!("\x1b[101m{}\x1b[0m", $str)
156 });
157 ( $other: expr) => ({
159 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
160 &format!("\x1b[101m{}\x1b[0m", $other)
161 })
162}
163
164#[macro_export]
165macro_rules! bg_light_green {
166 ( $str: tt ) => ({
167 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
168 &format!("\x1b[102m{}\x1b[0m", $str)
169 });
170 ( $other: expr) => ({
172 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
173 &format!("\x1b[102m{}\x1b[0m", $other)
174 })
175}
176
177#[macro_export]
178macro_rules! bg_light_yellow {
179 ( $str: tt ) => ({
180 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
181 &format!("\x1b[103m{}\x1b[0m", $str)
182 });
183 ( $other: expr) => ({
185 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
186 &format!("\x1b[103m{}\x1b[0m", $other)
187 })
188}
189
190#[macro_export]
191macro_rules! bg_light_blue {
192 ( $str: tt ) => ({
193 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
194 &format!("\x1b[104m{}\x1b[0m", $str)
195 });
196 ( $other: expr) => ({
198 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
199 &format!("\x1b[104m{}\x1b[0m", $other)
200 })
201}
202
203#[macro_export]
204macro_rules! bg_light_magenta {
205 ( $str: tt ) => ({
206 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
207 &format!("\x1b[105m{}\x1b[0m", $str)
208 });
209 ( $other: expr) => ({
211 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
212 &format!("\x1b[105m{}\x1b[0m", $other)
213 })
214}
215
216#[macro_export]
217macro_rules! bg_light_cyan {
218 ( $str: tt ) => ({
219 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
220 &format!("\x1b[106m{}\x1b[0m", $str)
221 });
222 ( $other: expr) => ({
224 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
225 &format!("\x1b[106m{}\x1b[0m", $other)
226 })
227}
228
229#[macro_export]
230macro_rules! bg_white {
231 ( $str: tt ) => ({
232 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
233 &format!("\x1b[107m{}\x1b[0m", $str)
234 });
235 ( $other: expr) => ({
237 use simple_colors::custom::Style as be_jonaseveraert_colors_custom_style;
238 &format!("\x1b[107m{}\x1b[0m", $other)
239 })
240}