pub struct Rgb<T = u8, S = Srgb> {
pub r: T,
pub g: T,
pub b: T,
/* private fields */
}
Fields§
§r: T
§g: T
§b: T
Implementations§
source§impl<T: Channel, S: TransferFunction> Rgb<T, S>
impl<T: Channel, S: TransferFunction> Rgb<T, S>
pub fn from_hex(hex: u32) -> Rgb<T, S>
pub fn rg(&self) -> Rg<T, S>
pub fn rb(&self) -> Rg<T, S>
pub fn gr(&self) -> Rg<T, S>
pub fn gb(&self) -> Rg<T, S>
pub fn br(&self) -> Rg<T, S>
pub fn bg(&self) -> Rg<T, S>
pub fn rgb(&self) -> Rgb<T, S>
pub fn rbg(&self) -> Rgb<T, S>
pub fn bgr(&self) -> Rgb<T, S>
pub fn brg(&self) -> Rgb<T, S>
pub fn grb(&self) -> Rgb<T, S>
pub fn gbr(&self) -> Rgb<T, S>
source§impl<T: Channel, S: TransferFunction> Rgb<T, S>
impl<T: Channel, S: TransferFunction> Rgb<T, S>
pub fn to_standard<S2: TransferFunction>(&self) -> Rgb<T, S2>
pub fn to_linear(&self) -> Rgb<T, LinearRgb>
source§impl Rgb<f32>
impl Rgb<f32>
pub fn gamut_clip_preserve_chroma(&self) -> Rgb<f32>
pub fn gamut_clip_project_to_0_5(&self) -> Rgb<f32>
pub fn gamut_clip_project_to_l_cusp(&self) -> Rgb<f32>
pub fn gamut_clip_adaptive_l0_0_5(&self) -> Rgb<f32>
pub fn gamut_clip_adaptive_l0_0_5_alpha(&self, alpha: f32) -> Rgb<f32>
pub fn gamut_clip_adaptive_l0_l_cusp(&self) -> Rgb<f32>
pub fn gamut_clip_adaptive_l0_l_cusp_alpha(&self, alpha: f32) -> Rgb<f32>
Trait Implementations§
source§impl<T, S> BorrowMut<[T; 3]> for Rgb<T, S>
impl<T, S> BorrowMut<[T; 3]> for Rgb<T, S>
source§fn borrow_mut(&mut self) -> &mut [T; 3]
fn borrow_mut(&mut self) -> &mut [T; 3]
Mutably borrows from an owned value. Read more
source§impl<T: Channel, S> Color<T> for Rgb<T, S>
impl<T: Channel, S> Color<T> for Rgb<T, S>
source§impl<'de, T, S> Deserialize<'de> for Rgb<T, S>where
T: Deserialize<'de>,
impl<'de, T, S> Deserialize<'de> for Rgb<T, S>where T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: FloatChannel, S> FloatColor<T> for Rgb<T, S>
impl<T: FloatChannel, S> FloatColor<T> for Rgb<T, S>
source§impl<N: Clone + PartialEq + Num + NumCast, S> PartialEq<Rgb<N, S>> for Rgb<N, S>
impl<N: Clone + PartialEq + Num + NumCast, S> PartialEq<Rgb<N, S>> for Rgb<N, S>
source§impl<T: Channel + Saturating, S> Saturating for Rgb<T, S>
impl<T: Channel + Saturating, S> Saturating for Rgb<T, S>
source§fn saturating_add(self, v: Rgb<T, S>) -> Rgb<T, S>
fn saturating_add(self, v: Rgb<T, S>) -> Rgb<T, S>
Saturating addition operator.
Returns a+b, saturating at the numeric bounds instead of overflowing.
source§fn saturating_sub(self, v: Rgb<T, S>) -> Rgb<T, S>
fn saturating_sub(self, v: Rgb<T, S>) -> Rgb<T, S>
Saturating subtraction operator.
Returns a-b, saturating at the numeric bounds instead of overflowing.
source§impl<T: Channel + Float + NumCast, S: MatrixColorSpace + TransferFunction> ToOkLab for Rgb<T, S>
impl<T: Channel + Float + NumCast, S: MatrixColorSpace + TransferFunction> ToOkLab for Rgb<T, S>
source§impl<T: Channel, S: MatrixColorSpace + TransferFunction> ToXyz for Rgb<T, S>
impl<T: Channel, S: MatrixColorSpace + TransferFunction> ToXyz for Rgb<T, S>
impl<T: Copy, S> Copy for Rgb<T, S>
impl<N: Clone + PartialEq + Eq + Num + NumCast, S> Eq for Rgb<N, S>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more