#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

#29 in #color-string

Download history 217/week @ 2024-01-02 170/week @ 2024-01-09 146/week @ 2024-01-16 123/week @ 2024-01-23 98/week @ 2024-01-30 136/week @ 2024-02-06 279/week @ 2024-02-13 208/week @ 2024-02-20 68/week @ 2024-02-27 200/week @ 2024-03-05 212/week @ 2024-03-12 157/week @ 2024-03-19 407/week @ 2024-03-26 163/week @ 2024-04-02 199/week @ 2024-04-09 272/week @ 2024-04-16

1,072 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