#[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: f32
The L* value (achromatic luminance) of the colour in 0–100 range.
This is the same value as in the Luv
object.
c: f32
The 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: f32
The 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§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