Struct Ansi256Color
#[repr(transparent)]
pub struct Ansi256Color(pub u8);
256 (8-bit) color support
Fields
0: u8
Implementations
impl Ansi256Color
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 foregroundconst fn index(self) -> u8Get the raw value
const fn into_ansi(self) -> Option<AnsiColor>Convert to
AnsiColorwhen there is a 1:1 mappingconst fn from_ansi(color: AnsiColor) -> SelfLosslessly convert from
AnsiColorfn 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 Ansi256Color
fn clone(&self) -> Self
impl Copy for Ansi256Color
impl Debug for Ansi256Color
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Ansi256Color
impl From<AnsiColor> for Ansi256Color
fn from(inner: AnsiColor) -> Self
impl From<u8> for Ansi256Color
fn from(inner: u8) -> Self
impl Hash for Ansi256Color
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Ansi256Color
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Ansi256Color
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Ansi256Color
fn partial_cmp(&self, other: &Self) -> Option<Ordering>