Skip to main content

ColorParam

Struct ColorParam 

Source
#[repr(transparent)]
pub struct ColorParam(pub u32);
Expand description

A effect/color parameter

Wraps a raw u32 value that represents the ANSI Select Graphic Rendition (SGR) parameter

§Examples

use tinycolor::ColorParam;
 
let bold = ColorParam::BOLD;
assert_eq!(bold.0, 1);

§Feature Flags

  • color-ext: Enables additional ANSI parameters (RAPID_BLINK, CONCEAL, FRAKTUR)
  • serde: Enables serialization/deserialization support

For more information on SGR parameters, look at https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters

Tuple Fields§

§0: u32

Implementations§

Source§

impl ColorParam

Source

pub const BOLD: Self

Source

pub const DIM: Self

Source

pub const ITALIC: Self

Source

pub const UNDERLINE: Self

Source

pub const INVERT: Self

Source

pub const STRIKETHROUGH: Self

Source

pub const BLACK: Self

Source

pub const RED: Self

Source

pub const GREEN: Self

Source

pub const YELLOW: Self

Source

pub const BLUE: Self

Source

pub const MAGENTA: Self

Source

pub const CYAN: Self

Source

pub const WHITE: Self

Source

pub const RGB: Self

Source

pub const ON_BLACK: Self

Source

pub const ON_RED: Self

Source

pub const ON_GREEN: Self

Source

pub const ON_YELLOW: Self

Source

pub const ON_BLUE: Self

Source

pub const ON_MAGENTA: Self

Source

pub const ON_CYAN: Self

Source

pub const ON_WHITE: Self

Source

pub const ON_RGB: Self

Source

pub const BRIGHT_BLACK: Self

Source

pub const BRIGHT_RED: Self

Source

pub const BRIGHT_GREEN: Self

Source

pub const BRIGHT_YELLOW: Self

Source

pub const BRIGHT_BLUE: Self

Source

pub const BRIGHT_MAGENTA: Self

Source

pub const BRIGHT_CYAN: Self

Source

pub const BRIGHT_WHITE: Self

Source

pub const ON_BRIGHT_BLACK: Self

Source

pub const ON_BRIGHT_RED: Self

Source

pub const ON_BRIGHT_GREEN: Self

Source

pub const ON_BRIGHT_YELLOW: Self

Source

pub const ON_BRIGHT_BLUE: Self

Source

pub const ON_BRIGHT_MAGENTA: Self

Source

pub const ON_BRIGHT_CYAN: Self

Source

pub const ON_BRIGHT_WHITE: Self

Trait Implementations§

Source§

impl Clone for ColorParam

Source§

fn clone(&self) -> ColorParam

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColorParam

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ColorParam

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ColorParam

Source§

fn eq(&self, other: &ColorParam) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ColorParam

Source§

impl Eq for ColorParam

Source§

impl StructuralPartialEq for ColorParam

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.