Struct color::Rgb[][src]

pub struct Rgb<T = u8, S = Srgb> {
    pub r: T,
    pub g: T,
    pub b: T,
    // some fields omitted
}

Fields

r: Tg: Tb: T

Implementations

impl<T, S> Rgb<T, S>[src]

pub const fn new(r: T, g: T, b: T) -> Rgb<T, S>[src]

impl<T: Channel, S: TransferFunction> Rgb<T, S>[src]

pub fn from_hex(hex: u32) -> Rgb<T, S>[src]

pub fn rg(&self) -> Rg<T, S>[src]

pub fn rb(&self) -> Rg<T, S>[src]

pub fn gr(&self) -> Rg<T, S>[src]

pub fn gb(&self) -> Rg<T, S>[src]

pub fn br(&self) -> Rg<T, S>[src]

pub fn bg(&self) -> Rg<T, S>[src]

pub fn rgb(&self) -> Rgb<T, S>[src]

pub fn rbg(&self) -> Rgb<T, S>[src]

pub fn bgr(&self) -> Rgb<T, S>[src]

pub fn brg(&self) -> Rgb<T, S>[src]

pub fn grb(&self) -> Rgb<T, S>[src]

pub fn gbr(&self) -> Rgb<T, S>[src]

impl<T: Channel, S: TransferFunction> Rgb<T, S>[src]

pub fn to_standard<S2: TransferFunction>(&self) -> Rgb<T, S2>[src]

pub fn to_linear(&self) -> Rgb<T, LinearRgb>[src]

Trait Implementations

impl<T: Channel + Add<T, Output = T>, S> Add<Rgb<T, S>> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the + operator.

impl<T, S> AsMut<[T; 3]> for Rgb<T, S>[src]

impl<T, S> AsRef<[T; 3]> for Rgb<T, S>[src]

impl<T, S> Borrow<[T; 3]> for Rgb<T, S>[src]

impl<T, S> BorrowMut<[T; 3]> for Rgb<T, S>[src]

impl<T: Clone, S> Clone for Rgb<T, S>[src]

impl<T: Channel, S> Color<T> for Rgb<T, S>[src]

fn clamp_s(self, lo: T, hi: T) -> Rgb<T, S>[src]

Clamps the components of the color to the range (lo,hi).

fn clamp_c(self, lo: Rgb<T, S>, hi: Rgb<T, S>) -> Rgb<T, S>[src]

Clamps the components of the color component-wise between lo and hi.

fn inverse(self) -> Rgb<T, S>[src]

Inverts the color.

impl<T: Debug, S: Default + Debug> Debug for Rgb<T, S>[src]

impl<'de, T, S> Deserialize<'de> for Rgb<T, S> where
    T: Deserialize<'de>, 
[src]

impl<T: Channel, S> Div<Rgb<T, S>> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the / operator.

impl<T: Channel + Div<T, Output = T>, S> Div<T> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the / operator.

impl<T: FloatChannel, S> FloatColor<T> for Rgb<T, S>[src]

fn saturate(self) -> Rgb<T, S>[src]

Clamps the components of the color to the range (0,1).

impl<T: Channel, S> From<Rgb<T, S>> for Vec3<T>[src]

impl<T, S> Index<usize> for Rgb<T, S>[src]

type Output = T

The returned type after indexing.

impl<T, S> IndexMut<usize> for Rgb<T, S>[src]

impl<T: Channel, S> Mul<Rgb<T, S>> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the * operator.

impl<T: Channel + Mul<T, Output = T>, S> Mul<T> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the * operator.

impl<N: Clone + PartialEq + Num + NumCast, S> PartialEq<Rgb<N, S>> for Rgb<N, S>[src]

impl<T: Channel + Saturating, S> Saturating for Rgb<T, S>[src]

impl<T, S> Serialize for Rgb<T, S> where
    T: Serialize
[src]

impl<T: Channel + Sub<T, Output = T>, S> Sub<Rgb<T, S>> for Rgb<T, S>[src]

type Output = Rgb<T, S>

The resulting type after applying the - operator.

impl<T: Channel, S: TransferFunction> ToHsv for Rgb<T, S>[src]

type Standard = S

impl<T: Channel, S: TransferFunction> ToLuma for Rgb<T, S>[src]

type Standard = S

impl<T: Channel, S: TransferFunction> ToRgb for Rgb<T, S>[src]

type Standard = S

impl<T: Channel, S: TransferFunction> ToRgba for Rgb<T, S>[src]

type Standard = S

impl<T: Channel, S: MatrixColorSpace + TransferFunction> ToXyz for Rgb<T, S>[src]

type WhitePoint = D65

impl<T: Copy, S> Copy for Rgb<T, S>[src]

impl<N: Clone + PartialEq + Eq + Num + NumCast, S> Eq for Rgb<N, S>[src]

Auto Trait Implementations

impl<T, S> RefUnwindSafe for Rgb<T, S> where
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, S> Send for Rgb<T, S> where
    S: Send,
    T: Send

impl<T, S> Sync for Rgb<T, S> where
    S: Sync,
    T: Sync

impl<T, S> Unpin for Rgb<T, S> where
    S: Unpin,
    T: Unpin

impl<T, S> UnwindSafe for Rgb<T, S> where
    S: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]