pub struct GreyAlpha<T: Float + Send + Sync> { /* private fields */ }Expand description
Grey with alpha channel.
Implementations§
Source§impl<T: Float + Send + Sync> GreyAlpha<T>
impl<T: Float + Send + Sync> GreyAlpha<T>
Sourcepub fn new(grey: T, alpha: T) -> Result<Self, ChromaticError>
pub fn new(grey: T, alpha: T) -> Result<Self, ChromaticError>
Sourcepub fn set_grey(&mut self, grey: T) -> Result<(), ChromaticError>
pub fn set_grey(&mut self, grey: T) -> Result<(), ChromaticError>
Sourcepub fn set_alpha(&mut self, alpha: T) -> Result<(), ChromaticError>
pub fn set_alpha(&mut self, alpha: T) -> Result<(), ChromaticError>
Sourcepub fn set_components(
&mut self,
grey: T,
alpha: T,
) -> Result<(), ChromaticError>
pub fn set_components( &mut self, grey: T, alpha: T, ) -> Result<(), ChromaticError>
Trait Implementations§
Source§impl<T: Float + Send + Sync> Colour<T, { $base_components + 1 }> for GreyAlpha<T>
impl<T: Float + Send + Sync> Colour<T, { $base_components + 1 }> for GreyAlpha<T>
Source§fn from_hex(hex: &str) -> Result<Self, ChromaticError>
fn from_hex(hex: &str) -> Result<Self, ChromaticError>
Create a new colour from a hex string. Read more
Source§fn to_hex(&self) -> Result<String, ChromaticError>
fn to_hex(&self) -> Result<String, ChromaticError>
Convert the colour to a hex string. Read more
Source§fn from_bytes(bytes: [u8; 2]) -> Result<Self, ChromaticError>
fn from_bytes(bytes: [u8; 2]) -> Result<Self, ChromaticError>
Create a new colour from a byte array. Read more
Source§fn to_bytes(self) -> Result<[u8; 2], ChromaticError>
fn to_bytes(self) -> Result<[u8; 2], ChromaticError>
Convert the colour to a byte array. Read more
Source§fn lerp(lhs: &Self, rhs: &Self, t: T) -> Result<Self, ChromaticError>
fn lerp(lhs: &Self, rhs: &Self, t: T) -> Result<Self, ChromaticError>
Linear interpolate between two colours of the same type. Read more
Source§const NUM_COMPONENTS: usize = N
const NUM_COMPONENTS: usize = N
Number of components in the colour.
Source§fn mix(colours: &[Self], weights: &[T]) -> Result<Self, ChromaticError>
fn mix(colours: &[Self], weights: &[T]) -> Result<Self, ChromaticError>
Mix multiple colours using weighted interpolation. Read more
Source§impl<T: Float + Send + Sync> Convert<T> for GreyAlpha<T>
impl<T: Float + Send + Sync> Convert<T> for GreyAlpha<T>
Source§fn to_grey(&self) -> Result<Grey<T>, ChromaticError>
fn to_grey(&self) -> Result<Grey<T>, ChromaticError>
Convert a colour to the
Grey colour space. Read moreSource§fn to_grey_alpha(&self) -> Result<GreyAlpha<T>, ChromaticError>
fn to_grey_alpha(&self) -> Result<GreyAlpha<T>, ChromaticError>
Convert a colour to the
GreyAlpha colour space. Read moreSource§fn to_hsl(&self) -> Result<Hsl<T>, ChromaticError>
fn to_hsl(&self) -> Result<Hsl<T>, ChromaticError>
Convert a colour to the
Hsl colour space. Read moreSource§fn to_hsl_alpha(&self) -> Result<HslAlpha<T>, ChromaticError>
fn to_hsl_alpha(&self) -> Result<HslAlpha<T>, ChromaticError>
Convert a colour to the
HslAlpha colour space. Read moreSource§fn to_hsv(&self) -> Result<Hsv<T>, ChromaticError>
fn to_hsv(&self) -> Result<Hsv<T>, ChromaticError>
Convert a colour to the
Hsv colour space. Read moreSource§fn to_hsv_alpha(&self) -> Result<HsvAlpha<T>, ChromaticError>
fn to_hsv_alpha(&self) -> Result<HsvAlpha<T>, ChromaticError>
Convert a colour to the
HsvAlpha colour space. Read moreSource§fn to_lab(&self) -> Result<Lab<T>, ChromaticError>
fn to_lab(&self) -> Result<Lab<T>, ChromaticError>
Convert a colour to the
Lab colour space. Read moreSource§fn to_lab_alpha(&self) -> Result<LabAlpha<T>, ChromaticError>
fn to_lab_alpha(&self) -> Result<LabAlpha<T>, ChromaticError>
Convert a colour to the
LabAlpha colour space. Read moreSource§fn to_rgb(&self) -> Result<Rgb<T>, ChromaticError>
fn to_rgb(&self) -> Result<Rgb<T>, ChromaticError>
Convert a colour to the
Rgb colour space. Read moreSource§fn to_rgb_alpha(&self) -> Result<RgbAlpha<T>, ChromaticError>
fn to_rgb_alpha(&self) -> Result<RgbAlpha<T>, ChromaticError>
Convert a colour to the
RgbAlpha colour space. Read moreSource§fn to_srgb(&self) -> Result<Srgb<T>, ChromaticError>
fn to_srgb(&self) -> Result<Srgb<T>, ChromaticError>
Convert a colour to the
Srgb colour space. Read moreSource§fn to_srgb_alpha(&self) -> Result<SrgbAlpha<T>, ChromaticError>
fn to_srgb_alpha(&self) -> Result<SrgbAlpha<T>, ChromaticError>
Convert a colour to the
SrgbAlpha colour space. Read moreSource§fn to_xyz(&self) -> Result<Xyz<T>, ChromaticError>
fn to_xyz(&self) -> Result<Xyz<T>, ChromaticError>
Convert a colour to the
Xyz colour space. Read moreSource§fn to_xyz_alpha(&self) -> Result<XyzAlpha<T>, ChromaticError>
fn to_xyz_alpha(&self) -> Result<XyzAlpha<T>, ChromaticError>
Convert a colour to the
XyzAlpha colour space. Read moreimpl<T: Copy + Float + Send + Sync> Copy for GreyAlpha<T>
Auto Trait Implementations§
impl<T> Freeze for GreyAlpha<T>where
T: Freeze,
impl<T> RefUnwindSafe for GreyAlpha<T>where
T: RefUnwindSafe,
impl<T> Send for GreyAlpha<T>
impl<T> Sync for GreyAlpha<T>
impl<T> Unpin for GreyAlpha<T>where
T: Unpin,
impl<T> UnsafeUnpin for GreyAlpha<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for GreyAlpha<T>where
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