#ansi-colors #color-string #compile-time #colored #proc-macro

macro ansi-colors-macro

A proc-macro for creating ANSI colored strings at compile time

3 releases

0.1.2 Mar 11, 2021
0.1.1 Mar 11, 2021
0.1.0 Mar 11, 2021

#32 in #colored

Download history 171/week @ 2024-03-13 217/week @ 2024-03-20 363/week @ 2024-03-27 132/week @ 2024-04-03 275/week @ 2024-04-10 268/week @ 2024-04-17 262/week @ 2024-04-24 237/week @ 2024-05-01 187/week @ 2024-05-08 220/week @ 2024-05-15 188/week @ 2024-05-22 166/week @ 2024-05-29 111/week @ 2024-06-05 79/week @ 2024-06-12 75/week @ 2024-06-19 106/week @ 2024-06-26

381 downloads per month
Used in terminal-log-symbols

Apache-2.0 OR MIT

9KB
138 lines

ansi-colors-macro

A proc-macro for creating colored ANSI strings at compile-time.

Usage

use ansi_colors_macro::ansi_string;

const DONE_MSG: &str = ansi_string!("{green Done}");

Shortcomings

  • Supports foreground colors only. The syntax has to be expanded for background colors and styling as well. PRs welcome. Please open an issue so we can exchange ideas beforehand!

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps