Struct RgbColor
pub struct RgbColor(pub u8, pub u8, pub u8);
24-bit ANSI RGB color codes
Fields
0: u81: u82: u8
Implementations
impl RgbColor
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 r(self) -> u8Red
const fn g(self) -> u8Green
const fn b(self) -> u8Blue
fn 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 RgbColor
fn clone(&self) -> RgbColor
impl Copy for RgbColor
impl Debug for RgbColor
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for RgbColor
impl From<(u8, u8, u8)> for RgbColor
fn from(inner: (u8, u8, u8)) -> Self
impl Hash for RgbColor
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for RgbColor
fn cmp(&self, other: &RgbColor) -> Ordering
impl PartialEq for RgbColor
fn eq(&self, other: &RgbColor) -> bool
impl PartialOrd for RgbColor
fn partial_cmp(&self, other: &RgbColor) -> Option<Ordering>
impl StructuralPartialEq for RgbColor
Auto Trait Implementations
impl Freeze for RgbColor
impl RefUnwindSafe for RgbColor
impl Send for RgbColor
impl Sync for RgbColor
impl Unpin for RgbColor
impl UnsafeUnpin for RgbColor
impl UnwindSafe for RgbColor
Blanket Implementations
impl<T> Any for RgbColor
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for RgbColor
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for RgbColor
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for RgbColor
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for RgbColor
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for RgbColor
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for RgbColor
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for RgbColor
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for RgbColor
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>