pub struct Rg32F(/* private fields */);Expand description
A two-channel (red, green) color represented as 2 f32s.
Implementations§
Source§impl Rg32F
impl Rg32F
Sourcepub const fn new(r: f32, g: f32) -> Self
pub const fn new(r: f32, g: f32) -> Self
Creates a new two-channel color from f32 red and green values.
Sourcepub const fn with_b(self, b: f32) -> Rgb32F
pub const fn with_b(self, b: f32) -> Rgb32F
Extends to a three-channel color by appending a blue component.
Sourcepub fn lerp(a: Self, b: Self, t: f32) -> Self
pub fn lerp(a: Self, b: Self, t: f32) -> Self
Linearly interpolates between two colors component-wise.
Sourcepub const fn distance_squared(a: Self, b: Self) -> f32
pub const fn distance_squared(a: Self, b: Self) -> f32
Returns the squared Euclidean distance.
Trait Implementations§
Source§impl FixedCode for Rg32F
impl FixedCode for Rg32F
const SIZE: usize
type Array = [u8; 8]
type Error = Infallible
fn fix_encode(&self) -> Self::Array
fn fix_decode(input: &Self::Array) -> Result<Self, Self::Error>
impl Copy for Rg32F
impl StructuralPartialEq for Rg32F
Auto Trait Implementations§
impl Freeze for Rg32F
impl RefUnwindSafe for Rg32F
impl Send for Rg32F
impl Sync for Rg32F
impl Unpin for Rg32F
impl UnsafeUnpin for Rg32F
impl UnwindSafe for Rg32F
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