pub struct LinearRgba(pub f32, pub f32, pub f32, pub f32);Expand description
A pixel value encoded as linear RGBA values in f32 format (range: 0.0-1.0)
Tuple Fields§
§0: f32§1: f32§2: f32§3: f32Implementations§
Source§impl LinearRgba
impl LinearRgba
pub const TRANSPARENT: LinearRgba
Sourcepub fn with_srgba(red: u8, green: u8, blue: u8, alpha: u8) -> LinearRgba
pub fn with_srgba(red: u8, green: u8, blue: u8, alpha: u8) -> LinearRgba
Convert SRGBA u8 components to LinearRgba. Note that alpha in SRGBA colorspace is already linear, so this only applies gamma correction to RGB.
Sourcepub fn with_rgba(red: u8, green: u8, blue: u8, alpha: u8) -> LinearRgba
pub fn with_rgba(red: u8, green: u8, blue: u8, alpha: u8) -> LinearRgba
Convert linear RGBA u8 components to LinearRgba (f32)
Sourcepub const fn with_components(
red: f32,
green: f32,
blue: f32,
alpha: f32,
) -> LinearRgba
pub const fn with_components( red: f32, green: f32, blue: f32, alpha: f32, ) -> LinearRgba
Create using the provided f32 components in the range 0.0-1.0
Sourcepub fn is_fully_transparent(self) -> bool
pub fn is_fully_transparent(self) -> bool
Returns true if this color is fully transparent
Sourcepub fn when_fully_transparent(self, other: LinearRgba) -> LinearRgba
pub fn when_fully_transparent(self, other: LinearRgba) -> LinearRgba
Returns self, except when self is transparent, in which case returns other
Sourcepub fn mul_alpha(self, alpha: f32) -> LinearRgba
pub fn mul_alpha(self, alpha: f32) -> LinearRgba
Returns self multiplied by the supplied alpha value
Sourcepub fn srgba_pixel(self) -> SrgbaPixel
pub fn srgba_pixel(self) -> SrgbaPixel
Convert to an SRGB u32 pixel
Sourcepub fn tuple(self) -> (f32, f32, f32, f32)
pub fn tuple(self) -> (f32, f32, f32, f32)
Returns the individual RGBA channels as f32 components 0.0-1.0
pub fn to_srgb(self) -> SrgbaTuple
Trait Implementations§
Source§impl Clone for LinearRgba
impl Clone for LinearRgba
Source§fn clone(&self) -> LinearRgba
fn clone(&self) -> LinearRgba
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearRgba
impl Debug for LinearRgba
Source§impl Default for LinearRgba
impl Default for LinearRgba
Source§fn default() -> LinearRgba
fn default() -> LinearRgba
Returns the “default value” for a type. Read more
Source§impl Hash for LinearRgba
impl Hash for LinearRgba
Source§impl PartialEq for LinearRgba
impl PartialEq for LinearRgba
impl Copy for LinearRgba
impl Eq for LinearRgba
impl StructuralPartialEq for LinearRgba
Auto Trait Implementations§
impl Freeze for LinearRgba
impl RefUnwindSafe for LinearRgba
impl Send for LinearRgba
impl Sync for LinearRgba
impl Unpin for LinearRgba
impl UnwindSafe for LinearRgba
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