color-output 9.0.0

An atomic output library based on Rust that supports output functionalities through functions, builders, and other methods. It allows customization of text and background colors.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::*;

/// Trait for converting colors to their ANSI escape sequences.
pub(crate) trait ColorDisplay {
    /// Gets the ANSI escape sequence for the color.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Reference to self
    /// - `DisplayType` - Whether to apply to text or background
    ///
    /// # Returns
    ///
    /// - `String` - The ANSI escape sequence string
    fn get_str(&self, display_type: DisplayType) -> String;
}