Struct color::Rgb [−][src]
pub struct Rgb<T> { pub r: T, pub g: T, pub b: T, }
Fields
r: T
g: T
b: T
Methods
impl<T: Channel> Rgb<T>
[src]
impl<T: Channel> Rgb<T>
pub fn new(r: T, g: T, b: T) -> Rgb<T>
[src]
pub fn new(r: T, g: T, b: T) -> Rgb<T>
pub fn rg(&self) -> Rg<T>
[src]
pub fn rg(&self) -> Rg<T>
pub fn rb(&self) -> Rg<T>
[src]
pub fn rb(&self) -> Rg<T>
pub fn gr(&self) -> Rg<T>
[src]
pub fn gr(&self) -> Rg<T>
pub fn gb(&self) -> Rg<T>
[src]
pub fn gb(&self) -> Rg<T>
pub fn br(&self) -> Rg<T>
[src]
pub fn br(&self) -> Rg<T>
pub fn bg(&self) -> Rg<T>
[src]
pub fn bg(&self) -> Rg<T>
pub fn rgb(&self) -> Rgb<T>
[src]
pub fn rgb(&self) -> Rgb<T>
pub fn rbg(&self) -> Rgb<T>
[src]
pub fn rbg(&self) -> Rgb<T>
pub fn bgr(&self) -> Rgb<T>
[src]
pub fn bgr(&self) -> Rgb<T>
pub fn brg(&self) -> Rgb<T>
[src]
pub fn brg(&self) -> Rgb<T>
pub fn grb(&self) -> Rgb<T>
[src]
pub fn grb(&self) -> Rgb<T>
pub fn gbr(&self) -> Rgb<T>
[src]
pub fn gbr(&self) -> Rgb<T>
Trait Implementations
impl<T: Clone> Clone for Rgb<T>
[src]
impl<T: Clone> Clone for Rgb<T>
fn clone(&self) -> 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[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Rgb<T>
[src]
impl<T: Copy> Copy for Rgb<T>
impl<T: PartialEq> PartialEq for Rgb<T>
[src]
impl<T: PartialEq> PartialEq for Rgb<T>
fn eq(&self, other: &Rgb<T>) -> bool
[src]
fn eq(&self, other: &Rgb<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rgb<T>) -> bool
[src]
fn ne(&self, other: &Rgb<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Rgb<T>
[src]
impl<T: Eq> Eq for Rgb<T>
impl<T: Debug> Debug for Rgb<T>
[src]
impl<T: Debug> Debug for Rgb<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Channel> Color<T> for Rgb<T>
[src]
impl<T: Channel> Color<T> for Rgb<T>
fn clamp_s(self, lo: T, hi: T) -> Rgb<T>
[src]
fn clamp_s(self, lo: T, hi: T) -> Rgb<T>
Clamps the components of the color to the range (lo,hi)
.
fn clamp_c(self, lo: Rgb<T>, hi: Rgb<T>) -> Rgb<T>
[src]
fn clamp_c(self, lo: Rgb<T>, hi: Rgb<T>) -> Rgb<T>
Clamps the components of the color component-wise between lo
and hi
.
fn inverse(self) -> Rgb<T>
[src]
fn inverse(self) -> Rgb<T>
Inverts the color.
fn mix(self, other: Self, value: T) -> Self
[src]
fn mix(self, other: Self, value: T) -> Self
impl<T: FloatChannel> FloatColor<T> for Rgb<T>
[src]
impl<T: FloatChannel> FloatColor<T> for Rgb<T>
impl<T: Clone + Channel> ToRgb for Rgb<T>
[src]
impl<T: Clone + Channel> ToRgb for Rgb<T>
impl<T: Channel> Mul for Rgb<T>
[src]
impl<T: Channel> Mul for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Rgb<T>) -> Rgb<T>
[src]
fn mul(self, rhs: Rgb<T>) -> Rgb<T>
Performs the *
operation.
impl<T: Channel + Mul<T, Output = T>> Mul<T> for Rgb<T>
[src]
impl<T: Channel + Mul<T, Output = T>> Mul<T> for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Rgb<T>
[src]
fn mul(self, rhs: T) -> Rgb<T>
Performs the *
operation.
impl<T: Channel> Div for Rgb<T>
[src]
impl<T: Channel> Div for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: Rgb<T>) -> Rgb<T>
[src]
fn div(self, rhs: Rgb<T>) -> Rgb<T>
Performs the /
operation.
impl<T: Channel + Div<T, Output = T>> Div<T> for Rgb<T>
[src]
impl<T: Channel + Div<T, Output = T>> Div<T> for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Rgb<T>
[src]
fn div(self, rhs: T) -> Rgb<T>
Performs the /
operation.
impl<T: Channel + Add<T, Output = T>> Add for Rgb<T>
[src]
impl<T: Channel + Add<T, Output = T>> Add for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the +
operator.
fn add(self, rhs: Rgb<T>) -> Rgb<T>
[src]
fn add(self, rhs: Rgb<T>) -> Rgb<T>
Performs the +
operation.
impl<T: Channel + Sub<T, Output = T>> Sub for Rgb<T>
[src]
impl<T: Channel + Sub<T, Output = T>> Sub for Rgb<T>
type Output = Rgb<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Rgb<T>) -> Rgb<T>
[src]
fn sub(self, rhs: Rgb<T>) -> Rgb<T>
Performs the -
operation.
impl<T: Channel + Saturating> Saturating for Rgb<T>
[src]
impl<T: Channel + Saturating> Saturating for Rgb<T>
fn saturating_add(self, v: Rgb<T>) -> Rgb<T>
[src]
fn saturating_add(self, v: Rgb<T>) -> Rgb<T>
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing. Read more
fn saturating_sub(self, v: Rgb<T>) -> Rgb<T>
[src]
fn saturating_sub(self, v: Rgb<T>) -> Rgb<T>
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing. Read more
impl<T> Index<usize> for Rgb<T>
[src]
impl<T> Index<usize> for Rgb<T>
type Output = T
The returned type after indexing.
ⓘImportant traits for &'a mut Rfn index<'a>(&'a self, index: usize) -> &'a T
[src]
fn index<'a>(&'a self, index: usize) -> &'a T
Performs the indexing (container[index]
) operation.
impl<T> IndexMut<usize> for Rgb<T>
[src]
impl<T> IndexMut<usize> for Rgb<T>
ⓘImportant traits for &'a mut Rfn index_mut<'a>(&'a mut self, index: usize) -> &'a mut T
[src]
fn index_mut<'a>(&'a mut self, index: usize) -> &'a mut T
Performs the mutable indexing (container[index]
) operation.
impl<T> AsRef<[T; 3]> for Rgb<T>
[src]
impl<T> AsRef<[T; 3]> for Rgb<T>
impl<T> AsMut<[T; 3]> for Rgb<T>
[src]
impl<T> AsMut<[T; 3]> for Rgb<T>
impl<T: Channel + NumCast> ToHsv for Rgb<T>
[src]
impl<T: Channel + NumCast> ToHsv for Rgb<T>
impl<T: Channel> ToRgba for Rgb<T>
[src]
impl<T: Channel> ToRgba for Rgb<T>