Enum Color
pub enum Color
Any ANSI color code scheme
Variants
-
Ansi(AnsiColor) Available 4-bit ANSI color palette codes
The user's terminal defines the meaning of each palette code.
-
Ansi256(Ansi256Color) 256 (8-bit) color support
-
Rgb(RgbColor) 24-bit ANSI RGB color codes
Implementations
impl Color
fn on(self, background: impl Into<Color>) -> StyleCreate a [
Style][crate::Style] with this as the foregroundconst fn on_default(self) -> StyleCreate a [
Style][crate::Style] with this as the foregroundfn render_fg(self) -> impl Display + CopyRender the ANSI code for a foreground color
fn render_bg(self) -> impl Display + CopyRender the ANSI code for a background color
Trait Implementations
impl Clone for Color
fn clone(&self) -> Self
impl Copy for Color
impl Debug for Color
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Color
impl From<(u8, u8, u8)> for Color
fn from(inner: (u8, u8, u8)) -> Self
impl From<Ansi256Color> for Color
fn from(inner: Ansi256Color) -> Self
impl From<AnsiColor> for Color
fn from(inner: AnsiColor) -> Self
impl From<RgbColor> for Color
fn from(inner: RgbColor) -> Self
impl From<u8> for Color
fn from(inner: u8) -> Self
impl Hash for Color
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Color
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Color
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Color
fn partial_cmp(&self, other: &Self) -> Option<Ordering>