#[repr(C)]pub struct Luv {
pub l: f32,
pub u: f32,
pub v: f32,
}Expand description
Struct representing a color in CIE LUV, a.k.a. L*u*v*, color space
Fields§
§l: f32The L* value (achromatic luminance) of the colour in 0–100 range.
u: f32The u* value of the colour.
Together with v* value, it defines chromaticity of the colour. The u* coordinate represents colour’s position on red-green axis with negative values indicating more red and positive more green colour. Typical values are in -134–220 range (but exact range for ‘valid’ colours depends on luminance and v* value).
v: f32The u* value of the colour.
Together with u* value, it defines chromaticity of the colour. The v* coordinate represents colour’s position on blue-yellow axis with negative values indicating more blue and positive more yellow colour. Typical values are in -140–122 range (but exact range for ‘valid’ colours depends on luminance and u* value).
Implementations§
source§impl Luv
impl Luv
pub fn from_rgba(rgba: Rgba<u8>) -> Self
pub fn to_xyz(&self) -> Xyz
pub fn to_rgb(&self) -> Rgb<u8>
pub fn new(l: f32, u: f32, v: f32) -> Luv
pub const fn l_range() -> (f32, f32)
pub const fn u_range() -> (f32, f32)
pub const fn v_range() -> (f32, f32)
Trait Implementations§
source§impl AddAssign<f32> for Luv
impl AddAssign<f32> for Luv
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
+= operation. Read moresource§impl AddAssign for Luv
impl AddAssign for Luv
source§fn add_assign(&mut self, rhs: Luv)
fn add_assign(&mut self, rhs: Luv)
+= operation. Read moresource§impl DivAssign<f32> for Luv
impl DivAssign<f32> for Luv
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/= operation. Read moresource§impl DivAssign for Luv
impl DivAssign for Luv
source§fn div_assign(&mut self, rhs: Luv)
fn div_assign(&mut self, rhs: Luv)
/= operation. Read moresource§impl EuclideanDistance for Luv
impl EuclideanDistance for Luv
fn euclidean_distance(&self, other: Luv) -> f32
source§impl MulAssign<f32> for Luv
impl MulAssign<f32> for Luv
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*= operation. Read moresource§impl MulAssign for Luv
impl MulAssign for Luv
source§fn mul_assign(&mut self, rhs: Luv)
fn mul_assign(&mut self, rhs: Luv)
*= operation. Read moresource§impl PartialOrd for Luv
impl PartialOrd for Luv
source§impl SubAssign<f32> for Luv
impl SubAssign<f32> for Luv
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
-= operation. Read moresource§impl SubAssign for Luv
impl SubAssign for Luv
source§fn sub_assign(&mut self, rhs: Luv)
fn sub_assign(&mut self, rhs: Luv)
-= operation. Read moresource§impl TaxicabDistance for Luv
impl TaxicabDistance for Luv
fn taxicab_distance(&self, other: Self) -> f32
impl Copy for Luv
Auto Trait Implementations§
impl Freeze for Luv
impl RefUnwindSafe for Luv
impl Send for Luv
impl Sync for Luv
impl Unpin for Luv
impl UnwindSafe for Luv
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more