Skip to main content

color_output/color/
trait.rs

1use crate::*;
2
3/// Trait for converting colors to their ANSI escape sequences.
4pub trait ColorDisplay {
5    /// Gets the ANSI escape sequence for the color.
6    ///
7    /// # Arguments
8    ///
9    /// - `&Self` - Reference to self
10    /// - `DisplayType` - Whether to apply to text or background
11    ///
12    /// # Returns
13    ///
14    /// - `String` - The ANSI escape sequence string
15    fn get_str(&self, display_type: DisplayType) -> String;
16}