#[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: f32
The L* value (achromatic luminance) of the colour in 0–100 range.
u: f32
The 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: f32
The 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§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