pub struct LinColor(/* private fields */);
Expand description
Alpha premultiplied RGBA color in the linear color space (no gamma correction)
Implementations§
source§impl LinColor
impl LinColor
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn red(self) -> f32
pub fn green(self) -> f32
pub fn blue(self) -> f32
pub fn alpha(self) -> f32
pub fn distance(self, other: Self) -> f32
sourcepub fn unmultiply(self) -> f32x4
pub fn unmultiply(self) -> f32x4
Linear color is by default pre-multiplied by alpha, this function removes pre-multiplication.
Trait Implementations§
source§impl Color for LinColor
impl Color for LinColor
source§fn blend_over(self, other: Self) -> Self
fn blend_over(self, other: Self) -> Self
Blend other color on top of this color
source§fn with_alpha(self, alpha: Scalar) -> Self
fn with_alpha(self, alpha: Scalar) -> Self
Override alpha component of the color
source§fn lerp(self, other: Self, t: f32) -> Self
fn lerp(self, other: Self, t: f32) -> Self
Linear interpolation between self and other colors.
source§fn best_contrast(self, c0: Self, c1: Self) -> Self
fn best_contrast(self, c0: Self, c1: Self) -> Self
Pick color that produces the best contrast with self
source§impl PartialEq for LinColor
impl PartialEq for LinColor
impl Copy for LinColor
impl Pod for LinColor
impl StructuralPartialEq for LinColor
Auto Trait Implementations§
impl Freeze for LinColor
impl RefUnwindSafe for LinColor
impl Send for LinColor
impl Sync for LinColor
impl Unpin for LinColor
impl UnwindSafe for LinColor
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.