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

no-std concolor-control

Control console coloring across all dependencies

7 releases

0.0.7 Oct 6, 2021
0.0.6 Aug 4, 2021

#261 in Command-line interface

Download history 4672/week @ 2022-11-28 4086/week @ 2022-12-05 4632/week @ 2022-12-12 3005/week @ 2022-12-19 2499/week @ 2022-12-26 3342/week @ 2023-01-02 4440/week @ 2023-01-09 5258/week @ 2023-01-16 5475/week @ 2023-01-23 5250/week @ 2023-01-30 5242/week @ 2023-02-06 5626/week @ 2023-02-13 5350/week @ 2023-02-20 5573/week @ 2023-02-27 4683/week @ 2023-03-06 4251/week @ 2023-03-13

20,289 downloads per month
Used in 11 crates (3 directly)

MIT/Apache

20KB
354 lines

concolor-control

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

~44KB