#[repr(C)]pub struct Lch<Wp = D65, T = f32>{
pub l: T,
pub chroma: T,
pub hue: LabHue<T>,
pub white_point: PhantomData<Wp>,
}
Expand description
CIE L*C*h°, a polar version of CIE L*a*b*.
L*C*h° shares its range and perceptual uniformity with L*a*b*, but it’s a cylindrical color space, like HSL and HSV. This gives it the same ability to directly change the hue and colorfulness of a color, while preserving other visual aspects.
Fields§
§l: T
L* is the lightness of the color. 0.0 gives absolute black and 100.0 gives the brightest white.
chroma: T
C* is the colorfulness of the color. It’s similar to saturation. 0.0 gives gray scale colors, and numbers around 128-181 gives fully saturated colors. The upper limit of 128 should include the whole L*a*b* space and some more.
hue: LabHue<T>
The hue of the color, in degrees. Decides if it’s red, blue, purple, etc.
white_point: PhantomData<Wp>
The white point associated with the color’s illuminant and observer. D65 for 2 degree observer is used by default.
Implementations§
Trait Implementations§
source§impl<Wp, T> AbsDiffEq for Lch<Wp, T>
impl<Wp, T> AbsDiffEq for Lch<Wp, T>
source§fn default_epsilon() -> <Lch<Wp, T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Lch<Wp, T> as AbsDiffEq>::Epsilon
source§fn abs_diff_eq(
&self,
other: &Lch<Wp, T>,
epsilon: <T as AbsDiffEq>::Epsilon
) -> bool
fn abs_diff_eq( &self, other: &Lch<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon ) -> bool
source§fn abs_diff_ne(
&self,
other: &Lch<Wp, T>,
epsilon: <T as AbsDiffEq>::Epsilon
) -> bool
fn abs_diff_ne( &self, other: &Lch<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon ) -> bool
ApproxEq::abs_diff_eq
.source§impl<Wp, T> AddAssign<T> for Lch<Wp, T>
impl<Wp, T> AddAssign<T> for Lch<Wp, T>
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
+=
operation. Read moresource§impl<Wp, T> AddAssign for Lch<Wp, T>
impl<Wp, T> AddAssign for Lch<Wp, T>
source§fn add_assign(&mut self, other: Lch<Wp, T>)
fn add_assign(&mut self, other: Lch<Wp, T>)
+=
operation. Read moresource§impl<'de, Wp, T> Deserialize<'de> for Lch<Wp, T>
impl<'de, Wp, T> Deserialize<'de> for Lch<Wp, T>
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Lch<Wp, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Lch<Wp, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Lch<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Lch<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
source§impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
source§fn from(
color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Rgb<S, T>
fn from( color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Rgb<S, T>
source§impl<S, T> From<Lch<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
impl<S, T> From<Lch<<S as LumaStandard>::WhitePoint, T>> for Alpha<Luma<S, T>, T>
source§fn from(color: Lch<<S as LumaStandard>::WhitePoint, T>) -> Alpha<Luma<S, T>, T>
fn from(color: Lch<<S as LumaStandard>::WhitePoint, T>) -> Alpha<Luma<S, T>, T>
source§impl<S, T> From<Lch<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
impl<S, T> From<Lch<<S as LumaStandard>::WhitePoint, T>> for Luma<S, T>
source§fn from(color: Lch<<S as LumaStandard>::WhitePoint, T>) -> Luma<S, T>
fn from(color: Lch<<S as LumaStandard>::WhitePoint, T>) -> Luma<S, T>
source§impl<Wp, T, _S> From<Rgb<_S, T>> for Lch<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Rgb<_S, T>> for Lch<Wp, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T> FromColor<Wp, T> for Lch<Wp, T>
impl<Wp, T> FromColor<Wp, T> for Lch<Wp, T>
source§fn from_rgb<S>(inp: Rgb<Linear<S>, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
fn from_rgb<S>(inp: Rgb<Linear<S>, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
source§fn from_hsl<S>(inp: Hsl<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
fn from_hsl<S>(inp: Hsl<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
source§fn from_hsv<S>(inp: Hsv<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
fn from_hsv<S>(inp: Hsv<S, T>) -> Selfwhere
S: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T> Hue for Lch<Wp, T>
impl<Wp, T> Hue for Lch<Wp, T>
source§impl<Wp, T> IntoColor<Wp, T> for Lch<Wp, T>
impl<Wp, T> IntoColor<Wp, T> for Lch<Wp, T>
source§fn into_rgb<S>(self) -> Rgb<Linear<S>, T>where
S: RgbSpace<WhitePoint = Wp>,
fn into_rgb<S>(self) -> Rgb<Linear<S>, T>where
S: RgbSpace<WhitePoint = Wp>,
source§fn into_hsl<S>(self) -> Hsl<S, T>where
S: RgbSpace<WhitePoint = Wp>,
fn into_hsl<S>(self) -> Hsl<S, T>where
S: RgbSpace<WhitePoint = Wp>,
source§impl<S> IntoLinSrgba<S> for Lch<D65, S>
impl<S> IntoLinSrgba<S> for Lch<D65, S>
source§impl<Wp, T> Limited for Lch<Wp, T>
impl<Wp, T> Limited for Lch<Wp, T>
source§impl<Wp, T> PartialEq for Lch<Wp, T>
impl<Wp, T> PartialEq for Lch<Wp, T>
source§impl<Wp, T> Pixel<T> for Lch<Wp, T>
impl<Wp, T> Pixel<T> for Lch<Wp, T>
source§fn as_raw_mut<P>(&mut self) -> &mut P
fn as_raw_mut<P>(&mut self) -> &mut P
source§fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
source§fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
source§fn from_raw_slice(slice: &[T]) -> &[Self]
fn from_raw_slice(slice: &[T]) -> &[Self]
source§fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
source§impl<Wp, T> RelativeEq for Lch<Wp, T>
impl<Wp, T> RelativeEq for Lch<Wp, T>
source§fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
source§fn relative_eq(
&self,
other: &Lch<Wp, T>,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon
) -> bool
fn relative_eq( &self, other: &Lch<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon ) -> bool
source§fn relative_ne(
&self,
other: &Lch<Wp, T>,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon
) -> bool
fn relative_ne( &self, other: &Lch<Wp, T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon ) -> bool
ApproxEq::relative_eq
.source§impl<Wp, T> Serialize for Lch<Wp, T>
impl<Wp, T> Serialize for Lch<Wp, T>
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl<Wp, T> SubAssign<T> for Lch<Wp, T>
impl<Wp, T> SubAssign<T> for Lch<Wp, T>
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
-=
operation. Read moresource§impl<Wp, T> SubAssign for Lch<Wp, T>
impl<Wp, T> SubAssign for Lch<Wp, T>
source§fn sub_assign(&mut self, other: Lch<Wp, T>)
fn sub_assign(&mut self, other: Lch<Wp, T>)
-=
operation. Read moresource§impl<Wp, T> UlpsEq for Lch<Wp, T>
impl<Wp, T> UlpsEq for Lch<Wp, T>
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
impl<Wp, T> Copy for Lch<Wp, T>
impl<Wp, T> StructuralPartialEq for Lch<Wp, T>
Auto Trait Implementations§
impl<Wp, T> RefUnwindSafe for Lch<Wp, T>where
T: RefUnwindSafe,
Wp: RefUnwindSafe,
impl<Wp, T> Send for Lch<Wp, T>
impl<Wp, T> Sync for Lch<Wp, T>
impl<Wp, T> Unpin for Lch<Wp, T>
impl<Wp, T> UnwindSafe for Lch<Wp, T>where
T: UnwindSafe,
Wp: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
source§fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_from(color: S) -> Self
fn adapt_from(color: S) -> Self
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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, U> ConvertFrom<T> for U
impl<T, U> ConvertFrom<T> for U
source§fn convert_from(t: T) -> U
fn convert_from(t: T) -> U
source§fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
fn try_convert_from(t: T) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read moresource§fn convert_unclamped_from(val: T) -> Self
fn convert_unclamped_from(val: T) -> Self
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more