Struct dcolor::Rgb
[−]
[src]
#[repr(C)]pub struct Rgb<T> { pub r: T, pub g: T, pub b: T, }
Red-green-blue color type.
Fields
r: T
g: T
b: T
Methods
impl<T> Rgb<T>
[src]
fn from_lum(l: T) -> Rgb<T> where
T: Clone,
T: Clone,
fn new(r: T, g: T, b: T) -> Rgb<T>
fn with_alpha(self, a: T) -> Rgba<T>
Trait Implementations
impl<F, T> FromColor<Lum<F>> for Rgb<T> where
F: ClampInto<T>,
T: Clone,
[src]
F: ClampInto<T>,
T: Clone,
fn from_color(color: Lum<F>) -> Rgb<T>
impl<F, T> FromColor<Option<Lum<F>>> for Rgb<T> where
F: ClampInto<T>,
T: Clone + Clamp,
[src]
F: ClampInto<T>,
T: Clone + Clamp,
fn from_color(color: Option<Lum<F>>) -> Rgb<T>
impl<F, T> FromColor<Luma<F>> for Rgb<T> where
F: ClampInto<T>,
T: Clone,
[src]
F: ClampInto<T>,
T: Clone,
fn from_color(color: Luma<F>) -> Rgb<T>
impl<F, T> FromColor<Rgb<F>> for Rgb<T> where
F: ClampInto<T>,
[src]
F: ClampInto<T>,
fn from_color(color: Rgb<F>) -> Rgb<T>
impl<F, T> FromColor<Option<Rgb<F>>> for Rgb<T> where
F: ClampInto<T>,
T: Clamp,
[src]
F: ClampInto<T>,
T: Clamp,
fn from_color(color: Option<Rgb<F>>) -> Rgb<T>
impl<F, T> FromColor<Rgba<F>> for Rgb<T> where
F: ClampInto<T>,
[src]
F: ClampInto<T>,
fn from_color(color: Rgba<F>) -> Rgb<T>
impl<T> Mul<T> for Rgb<T> where
T: Copy + Mul<Output = T>,
[src]
T: Copy + Mul<Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator
fn mul(self, rhs: T) -> Rgb<T>
The method for the *
operator
impl<T> Div<T> for Rgb<T> where
T: Copy + Div<Output = T>,
[src]
T: Copy + Div<Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator
fn div(self, rhs: T) -> Rgb<T>
The method for the /
operator
impl<T> Add for Rgb<T> where
T: Add<Output = T>,
[src]
T: Add<Output = T>,
type Output = Rgb<T>
The resulting type after applying the +
operator
fn add(self, rhs: Rgb<T>) -> Rgb<T>
The method for the +
operator
impl<T> Sub for Rgb<T> where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
type Output = Rgb<T>
The resulting type after applying the -
operator
fn sub(self, rhs: Rgb<T>) -> Rgb<T>
The method for the -
operator
impl<T> Mul for Rgb<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
type Output = Rgb<T>
The resulting type after applying the *
operator
fn mul(self, rhs: Rgb<T>) -> Rgb<T>
The method for the *
operator
impl<T> Div for Rgb<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
type Output = Rgb<T>
The resulting type after applying the /
operator
fn div(self, rhs: Rgb<T>) -> Rgb<T>
The method for the /
operator
impl<T: Clone> Clone for Rgb<T>
[src]
fn clone(&self) -> Rgb<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Rgb<T>
[src]
impl<T: Debug> Debug for Rgb<T>
[src]
impl<T: Default> Default for Rgb<T>
[src]
impl<T: Eq> Eq for Rgb<T>
[src]
impl<T: Hash> Hash for Rgb<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: PartialEq> PartialEq for Rgb<T>
[src]
fn eq(&self, __arg_0: &Rgb<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rgb<T>) -> bool
This method tests for !=
.
impl<T> Clamp for Rgb<T> where
T: Clamp,
[src]
T: Clamp,
impl<S, T> Lerp<T> for Rgb<S> where
S: Lerp<T>,
T: Copy,
[src]
S: Lerp<T>,
T: Copy,
impl<T> Luminance for Rgb<T> where
T: ClampInto<f64>,
[src]
T: ClampInto<f64>,