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
17
18
use crate::*;

/// Configurable text display with color, background and style options.
///
/// Used for building formatted console output with various display attributes.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub(crate) struct Text<'a> {
    /// The actual text content.
    pub(crate) text: &'a str,
    /// The color of the text.
    pub(crate) color: ColorType,
    /// The background color of the text.
    pub(crate) bg_color: ColorType,
    /// Whether the text should be bold.
    pub(crate) bold: bool,
    /// Whether to add newline after the text
    pub(crate) endl: bool,
}