#cli-color #color #ansi #terminal #cli #no-std

no-std concolor

Control console coloring across all dependencies

6 releases

0.1.1 Mar 13, 2023
0.1.0 Mar 8, 2023
0.0.12 Feb 25, 2023
0.0.11 Nov 24, 2022
0.0.8 Jan 11, 2022

#24 in #cli-color

Download history 3790/week @ 2023-11-23 3882/week @ 2023-11-30 3723/week @ 2023-12-07 3926/week @ 2023-12-14 1902/week @ 2023-12-21 4037/week @ 2023-12-28 4528/week @ 2024-01-04 4330/week @ 2024-01-11 4261/week @ 2024-01-18 3552/week @ 2024-01-25 5361/week @ 2024-02-01 5841/week @ 2024-02-08 4888/week @ 2024-02-15 5410/week @ 2024-02-22 4861/week @ 2024-02-29 3720/week @ 2024-03-07

20,073 downloads per month
Used in 55 crates (10 directly)

MIT/Apache

22KB
314 lines

concolor

bin/lib API for managing terminal styling

Documentation License Crates Status

Features

  • Detects interactive stdout / stderr
  • Detects terminal capabilities via TERM
  • Detects and enables ANSI support on Windows
  • Supports CLICOLOR and NO_COLOR

Contribute

Special note: to be successful, this crate cannot break compatibility or else different crates in the hierarchy will be reading different globals. While end users can work around this, it isn't ideal. Once we hit 1.0, we should strive to keep the API compatible. If we need a new API, we can make the old API an adapter to the new logic.

Similarly, we should strive to reduce risk of breaking compatibility by exposing as little as possible. Anything more should be broken out into a separate crate that this crate can call into.

Special Thanks

Prior art for global colors control:

termcolor for identifying various corner cases with environment detection.

firestorm for zero-cost abstraction via bin/lib-specific Cargo.toml features.

License

Dual-licensed under MIT or Apache 2.0

Dependencies

~0–8.5MB
~47K SLoC