@@ -34,225 +34,6 @@ To install `color-output` run cmd:
3434cargo add color-output
3535```
3636
37- ## Code Examples
38-
39- ### Struct Output
40-
41- #### Using ` output ` Function
42-
43- ``` rust
44- use color_output :: * ;
45- output (Output {
46- text : " test_output_struct" ,
47- color : ColorType :: Use (Color :: Default ),
48- bg_color : ColorType :: Color256 (0x000000 ),
49- endl : true ,
50- .. Default :: default ()
51- });
52- ```
53-
54- #### Using ` output ` Method
55-
56- ``` rust
57- use color_output :: * ;
58- Output {
59- text : " test_output_struct_output" ,
60- color : ColorType :: Use (Color :: Default ),
61- bg_color : ColorType :: Use (Color :: Blue ),
62- endl : true ,
63- .. Default :: default ()
64- }
65- . output ();
66- ```
67-
68- ### Array of Structs
69-
70- ``` rust
71- use color_output :: * ;
72- OutputList (vec! [
73- Output {
74- text : " test_output_list_struct_1" ,
75- color : ColorType :: Use (Color :: Default ),
76- bg_color : ColorType :: Color256 (0x000000 ),
77- endl : false ,
78- .. Default :: default ()
79- },
80- Output {
81- text : " test_output_struct_output_2" ,
82- color : ColorType :: Use (Color :: Default ),
83- bg_color : ColorType :: Use (Color :: Blue ),
84- endl : true ,
85- .. Default :: default ()
86- },
87- ])
88- . output ();
89- ```
90-
91- ### Builder Output
92-
93- #### Using ` output ` Function
94-
95- ``` rust
96- use color_output :: * ;
97- output (
98- OutputBuilder :: new_from (Output :: default ())
99- . text (" test_output_builder" )
100- . color (ColorType :: Color256 (0xffffff ))
101- . bg_color (ColorType :: Color256 (0xffffff ))
102- . blod (true )
103- . endl (true )
104- . build (),
105- );
106- ```
107-
108- #### Using ` output ` Method
109-
110- ``` rust
111- use color_output :: * ;
112- OutputBuilder :: new ()
113- . text (" test_output_builder_output" )
114- . bg_color (ColorType :: Color256 (0xffffff ))
115- . color (ColorType :: Color256 (0xffffff ))
116- . blod (true )
117- . endl (true )
118- . build ()
119- . output ();
120- ```
121-
122- ### Array Builder
123-
124- ``` rust
125- use color_output :: * ;
126- OutputListBuilder :: new_from (vec! [Output :: default ()])
127- . add (
128- OutputBuilder :: new ()
129- . text (" text" )
130- . bg_color (ColorType :: Use (Color :: Blue ))
131- . endl (false )
132- . build (),
133- )
134- . add (Output {
135- text : " test_new_from_output_list_builder_1" ,
136- color : ColorType :: Use (Color :: Default ),
137- bg_color : ColorType :: Color256 (0x3f3f3f ),
138- endl : false ,
139- .. Default :: default ()
140- })
141- . add (Output {
142- text : " test_new_from_output_list_builder_2" ,
143- color : ColorType :: Use (Color :: Default ),
144- bg_color : ColorType :: Use (Color :: Cyan ),
145- endl : true ,
146- .. Default :: default ()
147- })
148- . run ();
149- ```
150-
151- ### Output Macros
152-
153- #### Passing Struct
154-
155- ``` rust
156- use color_output :: * ;
157- output_macro! (Output {
158- text : " test_proc_macro" ,
159- color : ColorType :: default (),
160- bg_color : ColorType :: Use (Color :: Yellow ),
161- endl : true ,
162- .. Default :: default ()
163- });
164- ```
165-
166- #### Passing Builder
167-
168- ``` rust
169- use color_output :: * ;
170- output_macro! (OutputBuilder :: new ()
171- . text (" test_output_builder" )
172- . color (ColorType :: Use (Color :: Cyan ))
173- . blod (true )
174- . endl (true )
175- . build ());
176- ```
177-
178- #### Multiple Inputs
179-
180- ``` rust
181- use color_output :: * ;
182- output_macro! (
183- Output {
184- text : " test_proc_macro" ,
185- color : ColorType :: default (),
186- bg_color : ColorType :: Use (Color :: Yellow ),
187- endl : true ,
188- .. Default :: default ()
189- },
190- OutputBuilder :: new ()
191- . text (" test_output_builder1" )
192- . color (ColorType :: Color256 (0xffffff ))
193- . blod (true )
194- . endl (true )
195- . build (),
196- OutputBuilder :: new ()
197- . text (" test_output_builder2" )
198- . color (ColorType :: Color256 (0xffffff ))
199- . blod (true )
200- . endl (true )
201- . build ()
202- );
203- ```
204-
205- #### println_success!
206-
207- > Outputs success information with a new line.
208-
209- ``` rust
210- use color_output :: * ;
211- println_success! (" 1234" , " 5678" );
212- ```
213-
214- #### println_warning!
215-
216- > Outputs warning information with a new line.
217-
218- ``` rust
219- use color_output :: * ;
220- println_warning! (" 1234" , " 5678" );
221- ```
222-
223- #### println_error!
224-
225- > Outputs error information with a new line.
226-
227- ``` rust
228- use color_output :: * ;
229- println_error! (" 1234" , " 5678" );
230- ```
231-
232- ### Color Usage
233-
234- - ` ColorType::Use ` : Use built-in colors.
235- - ` ColorType::Color256 ` : Hexadecimal colors.
236- - ` ColorType::Rgb ` : RGB color (r, g, b).
237-
238- #### ColorType::Use
239-
240- ``` rust
241- ColorType :: Use (Color :: White )
242- ```
243-
244- #### ColorType::Color256
245-
246- ``` rust
247- ColorType :: Color256 (0xffffff )
248- ```
249-
250- #### ColorType::Rgb
251-
252- ``` rust
253- ColorType :: Rgb (255 , 255 , 255 )
254- ```
255-
25637## License
25738
25839This project is licensed under the MIT License. See the [ LICENSE] ( LICENSE ) file for details.
0 commit comments