[][src]Struct pigmnts::color::LAB

pub struct LAB {
    pub l: f32,
    pub a: f32,
    pub b: f32,
}

Fields

l: f32a: f32b: f32

Methods

impl LAB[src]

pub fn from_rgb(r: u8, g: u8, b: u8) -> Self[src]

Helper function to create a LAB color from RGB values without creating intermediate struct

pub fn chroma(&self) -> f32[src]

Calculates the chroma of the color

pub fn nearest(&self, colors: &Vec<LAB>) -> (usize, f32)[src]

Finds the index and distance from nearest color from a group of colors

pub fn distance(&self, color: &LAB) -> f32[src]

Calculates Delta E(1994) between two colors

pub fn to_xyz(&self) -> (f32, f32, f32)[src]

Trait Implementations

impl Clone for LAB[src]

impl Display for LAB[src]

impl<'_> From<&'_ LAB> for RGB[src]

fn from(color: &LAB) -> Self[src]

Creates equivalent RGB color from LAB color

impl<'_> From<&'_ LAB> for HSL[src]

impl<'_> From<&'_ RGB> for LAB[src]

fn from(color: &RGB) -> Self[src]

Creates equivalent LAB color from RGB color

impl PartialEq<LAB> for LAB[src]

Auto Trait Implementations

impl RefUnwindSafe for LAB

impl Send for LAB

impl Sync for LAB

impl Unpin for LAB

impl UnwindSafe for LAB

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,