#[repr(C)]pub struct LCh {
pub l: f32,
pub c: f32,
pub h: f32,
}Expand description
Representing a color in cylindrical CIE LCh(uv) color space
Fields§
§l: f32The L* value (achromatic luminance) of the colour in 0–100 range.
This is the same value as in the Luv object.
c: f32The C*_uv value (chroma) of the colour.
Together with h_uv, it defines chromaticity of the colour. The typical values of the coordinate go from zero up to around 150 (but exact range for ‘valid’ colours depends on luminance and hue). Zero represents shade of grey.
h: f32The h_uv value (hue) of the colour measured in radians.
Together with C*_uv, it defines chromaticity of the colour. The value represents an angle thus it wraps around τ. Typically, the value will be in the -π–π range. The value is undefined if C*_uv is zero.
Implementations§
source§impl LCh
impl LCh
pub fn from_rgb(rgb: Rgb<u8>) -> Self
pub fn from_rgba(rgba: Rgba<u8>) -> Self
pub fn new(l: f32, c: f32, h: f32) -> Self
pub fn from_luv(luv: Luv) -> Self
pub fn to_rgb(&self) -> Rgb<u8>
pub fn to_xyz(&self) -> Xyz
pub fn to_linear_rgb(&self, matrix: &[[f32; 3]; 3]) -> Rgb<f32>
pub fn to_luv(&self) -> Luv
Trait Implementations§
source§impl AddAssign<f32> for LCh
impl AddAssign<f32> for LCh
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
Performs the
+= operation. Read moresource§impl AddAssign for LCh
impl AddAssign for LCh
source§fn add_assign(&mut self, rhs: LCh)
fn add_assign(&mut self, rhs: LCh)
Performs the
+= operation. Read moresource§impl DivAssign<f32> for LCh
impl DivAssign<f32> for LCh
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moresource§impl DivAssign for LCh
impl DivAssign for LCh
source§fn div_assign(&mut self, rhs: LCh)
fn div_assign(&mut self, rhs: LCh)
Performs the
/= operation. Read moresource§impl EuclideanDistance for LCh
impl EuclideanDistance for LCh
fn euclidean_distance(&self, other: LCh) -> f32
source§impl MulAssign<f32> for LCh
impl MulAssign<f32> for LCh
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moresource§impl MulAssign for LCh
impl MulAssign for LCh
source§fn mul_assign(&mut self, rhs: LCh)
fn mul_assign(&mut self, rhs: LCh)
Performs the
*= operation. Read moresource§impl PartialEq for LCh
impl PartialEq for LCh
source§impl PartialOrd for LCh
impl PartialOrd for LCh
source§impl SubAssign<f32> for LCh
impl SubAssign<f32> for LCh
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
Performs the
-= operation. Read moresource§impl SubAssign for LCh
impl SubAssign for LCh
source§fn sub_assign(&mut self, rhs: LCh)
fn sub_assign(&mut self, rhs: LCh)
Performs the
-= operation. Read moresource§impl TaxicabDistance for LCh
impl TaxicabDistance for LCh
fn taxicab_distance(&self, other: Self) -> f32
impl Copy for LCh
Auto Trait Implementations§
impl Freeze for LCh
impl RefUnwindSafe for LCh
impl Send for LCh
impl Sync for LCh
impl Unpin for LCh
impl UnwindSafe for LCh
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> 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)
🔬This is a nightly-only experimental API. (
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>
Converts
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>
Converts
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