Skip to main content

termprofile/
lib.rs

1#![warn(missing_docs, missing_debug_implementations)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![forbid(clippy::unwrap_used)]
4#![doc = include_str!("../README.md")]
5
6#[cfg(feature = "convert")]
7mod convert;
8mod detect;
9#[cfg(feature = "query-detect")]
10mod query;
11
12#[cfg(feature = "convert")]
13pub use anstyle;
14#[cfg(feature = "convert")]
15pub use convert::*;
16pub use detect::*;
17#[cfg(feature = "query-detect")]
18pub use query::*;
19
20/// Terminal color profile.
21#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
22pub enum TermProfile {
23    /// No terminal is attached. This may happen if the output is piped or if the program was not
24    /// ran from a TTY.
25    NoTty,
26    /// Text modifiers may be used, but no colors should be emitted.
27    NoColor,
28    /// 16 colors are supported.
29    Ansi16,
30    /// 256 colors are supported.
31    Ansi256,
32    /// Any RGB color is supported.
33    TrueColor,
34}