#syntax

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

#359 in #syntax

Download history 163/week @ 2024-07-21 157/week @ 2024-07-28 103/week @ 2024-08-04 193/week @ 2024-08-11 131/week @ 2024-08-18 77/week @ 2024-08-25 127/week @ 2024-09-01 152/week @ 2024-09-08 104/week @ 2024-09-15 136/week @ 2024-09-22 91/week @ 2024-09-29 80/week @ 2024-10-06 114/week @ 2024-10-13 125/week @ 2024-10-20 142/week @ 2024-10-27 102/week @ 2024-11-03

489 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