Struct Lch

Source
pub struct Lch {
    pub l: f64,
    pub c: f64,
    pub h: f64,
}
Expand description

An LCH color (luminance, chroma, hue).

Fields§

§l: f64§c: f64§h: f64

Implementations§

Source§

impl Lch

Source

pub fn new(l: f64, c: f64, h: f64) -> Self

Create a new CIELAB color.

l: luminance component (0 to 100).

c: chroma component (0 to 100).

h: hue component (0 to 360).

Trait Implementations§

Source§

impl Clone for Lch

Source§

fn clone(&self) -> Lch

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Lch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Lch

Source§

fn default() -> Lch

Returns the “default value” for a type. Read more
Source§

impl From<Cmy> for Lch

Source§

fn from(color: Cmy) -> Self

Converts to this type from the input type.
Source§

impl From<Cmyk> for Lch

Source§

fn from(color: Cmyk) -> Self

Converts to this type from the input type.
Source§

impl From<Hsl> for Lch

Source§

fn from(color: Hsl) -> Self

Converts to this type from the input type.
Source§

impl From<Hsv> for Lch

Source§

fn from(color: Hsv) -> Self

Converts to this type from the input type.
Source§

impl From<HunterLab> for Lch

Source§

fn from(color: HunterLab) -> Self

Converts to this type from the input type.
Source§

impl From<Lab> for Lch

Source§

fn from(color: Lab) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Cmy

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Cmyk

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Hsl

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Hsv

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for HunterLab

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Lab

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Luv

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Rgb

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Xyz

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Lch> for Yxy

Source§

fn from(color: Lch) -> Self

Converts to this type from the input type.
Source§

impl From<Luv> for Lch

Source§

fn from(color: Luv) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb> for Lch

Source§

fn from(color: Rgb) -> Self

Converts to this type from the input type.
Source§

impl From<Xyz> for Lch

Source§

fn from(color: Xyz) -> Self

Converts to this type from the input type.
Source§

impl From<Yxy> for Lch

Source§

fn from(color: Yxy) -> Self

Converts to this type from the input type.
Source§

impl FromColor<Cmy> for Lch

Source§

fn from_color(color: &Cmy) -> Self

Convert from another color space T.
Source§

impl FromColor<Cmyk> for Lch

Source§

fn from_color(color: &Cmyk) -> Self

Convert from another color space T.
Source§

impl FromColor<Hsl> for Lch

Source§

fn from_color(color: &Hsl) -> Self

Convert from another color space T.
Source§

impl FromColor<Hsv> for Lch

Source§

fn from_color(color: &Hsv) -> Self

Convert from another color space T.
Source§

impl FromColor<HunterLab> for Lch

Source§

fn from_color(color: &HunterLab) -> Self

Convert from another color space T.
Source§

impl FromColor<Lab> for Lch

Source§

fn from_color(color: &Lab) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Cmy

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Cmyk

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Hsl

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Hsv

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for HunterLab

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Lab

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Lch

Source§

fn from_color(color: &Self) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Luv

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Rgb

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Xyz

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Lch> for Yxy

Source§

fn from_color(color: &Lch) -> Self

Convert from another color space T.
Source§

impl FromColor<Luv> for Lch

Source§

fn from_color(color: &Luv) -> Self

Convert from another color space T.
Source§

impl FromColor<Rgb> for Lch

Source§

fn from_color(color: &Rgb) -> Self

Convert from another color space T.
Source§

impl FromColor<Xyz> for Lch

Source§

fn from_color(color: &Xyz) -> Self

Convert from another color space T.
Source§

impl FromColor<Yxy> for Lch

Source§

fn from_color(color: &Yxy) -> Self

Convert from another color space T.
Source§

impl FromRgb for Lch

Source§

fn from_rgb(rgb: &Rgb) -> Self

Convert from an Rgb color.
Source§

impl PartialEq for Lch

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToRgb for Lch

Source§

fn to_rgb(&self) -> Rgb

Convert into an Rgb color.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, U> CompareCie1976<U> for T
where T: ToRgb, U: ToRgb, Lab: FromColor<T> + FromColor<U>,

Source§

fn compare_cie1976(&self, color: &U) -> f64

Compare colors based on their CIE 1976 distance.
Source§

impl<T, U> CompareCie2000<U> for T
where T: ToRgb, U: ToRgb, Lab: FromColor<T> + FromColor<U>,

Source§

fn compare_cie2000(&self, color: &U) -> f64

Compare colors based on their CIE 2000 distance.
Source§

impl<T, U> CompareCmc<U> for T
where T: ToRgb, U: ToRgb, Lch: FromColor<T> + FromColor<U>,

Source§

fn compare_cmc(&self, color: &U) -> f64

Compare colors based on their CMC distance.
Source§

impl<T, U> CompareEuclidean<U> for T
where T: ToRgb, U: ToRgb,

Source§

fn compare_euclidean(&self, color: &U) -> f64

Compare colors based on their RGB distance.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.