[][src]Struct prisma::Lchab

#[repr(C)]pub struct Lchab<T, W, A = Deg<T>> { /* fields omitted */ }

The $\textrm{Lch}_{(\textrm{ab})}$ device-independent polar color space

Lchab is a simple polar transformation from Lab defined as:

\begin{aligned}
    L &= L \\
    C &= \sqrt{a^2 + b^2} \\
    H &= atan2(b, a)
\end{aligned}

It is a useful space for computing smooth gradients in a polar space, but like Lab is out of gamut for many values which are not bounded by a simple geometric object.

Implementations

impl<T, W, A> Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: UnitWhitePoint<T>, 
[src]

pub fn new(L: T, chroma: T, hue: A) -> Self[src]

Construct a new Lchab value with a named white point and channels

Unlike new_with_whitepoint, new constructs a default instance of a UnitWhitePoint. It is only valid when W is a UnitWhitePoint.

impl<T, W, A> Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: WhitePoint<T>, 
[src]

pub fn new_with_whitepoint(L: T, chroma: T, hue: A, white_point: W) -> Self[src]

Construct a new Lchab value with a given white point and channels

pub fn color_cast<TOut, AOut>(&self) -> Lchab<TOut, W, AOut> where
    T: ChannelFormatCast<TOut>,
    TOut: FreeChannelScalar,
    A: ChannelFormatCast<AOut>,
    AOut: AngularChannelScalar
[src]

Convert the internal channel scalar format

pub fn L(&self) -> T[src]

Returns the L lightness channel scalar

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

Returns the C chroma channel scalar

pub fn hue(&self) -> A[src]

Returns the H hue channel scalar

pub fn L_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the the L lightness channel scalar

pub fn chroma_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the the C chroma channel scalar

pub fn hue_mut(&mut self) -> &mut A[src]

Returns a mutable reference to the the L hue channel scalar

pub fn set_L(&mut self, val: T)[src]

Sets the L channel scalar

pub fn set_chroma(&mut self, val: T)[src]

Sets the chroma channel scalar

pub fn set_hue(&mut self, val: A)[src]

Sets the hue channel scalar

pub fn white_point(&self) -> &W[src]

Returns a reference to the white point for the Lchab color space

Trait Implementations

impl<T, W, A> AbsDiffEq<Lchab<T, W, A>> for Lchab<T, W, A> where
    T: FreeChannelScalar + AbsDiffEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + AbsDiffEq,
    A::Epsilon: Clone + Float,
    W: WhitePoint<T>, 
[src]

type Epsilon = T::Epsilon

Used for specifying relative comparisons.

impl<T, W, A> Bounded for Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: WhitePoint<T>, 
[src]

impl<T: Clone, W: Clone, A: Clone> Clone for Lchab<T, W, A>[src]

impl<T, W, A> Color for Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: WhitePoint<T>, 
[src]

type Tag = LchabTag

The unique tag unit struct identifying the color type

type ChannelsTuple = (T, T, A)

A tuple of types for each channel in the color

impl<T: Copy, W: Copy, A: Copy> Copy for Lchab<T, W, A>[src]

impl<T: Debug, W: Debug, A: Debug> Debug for Lchab<T, W, A>[src]

impl<T, W, A> Default for Lchab<T, W, A> where
    T: FreeChannelScalar + Zero,
    A: AngularChannelScalar + Zero,
    W: UnitWhitePoint<T>, 
[src]

impl<T, W, A> Display for Lchab<T, W, A> where
    T: FreeChannelScalar + Display,
    A: AngularChannelScalar + Display,
    W: WhitePoint<T>, 
[src]

impl<T, W, A> FromColor<Lab<T, W>> for Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar + FromAngle<Rad<T>> + Angle,
    W: WhitePoint<T>, 
[src]

fn from_color(from: &Lab<T, W>) -> Self[src]

Construct an Lchab value from a Lab value

impl<T, W, A> FromColor<Lchab<T, W, A>> for Lab<T, W> where
    T: FreeChannelScalar,
    A: AngularChannelScalar + Angle<Scalar = T>,
    W: WhitePoint<T>, 
[src]

fn from_color(from: &Lchab<T, W, A>) -> Self[src]

Construct a Lab value from an Lchab value

impl<T, W, A> FromTuple for Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: UnitWhitePoint<T>, 
[src]

impl<T, W, A> Lerp for Lchab<T, W, A> where
    T: FreeChannelScalar + Lerp,
    A: AngularChannelScalar + Lerp,
    W: WhitePoint<T>, 
[src]

type Position = A::Position

The type of the pos argument

impl<T: PartialEq, W: PartialEq, A: PartialEq> PartialEq<Lchab<T, W, A>> for Lchab<T, W, A>[src]

impl<T: PartialOrd, W: PartialOrd, A: PartialOrd> PartialOrd<Lchab<T, W, A>> for Lchab<T, W, A>[src]

impl<T, W, A> PolarColor for Lchab<T, W, A> where
    T: FreeChannelScalar,
    A: AngularChannelScalar,
    W: WhitePoint<T>, 
[src]

type Angular = A

The angular channel's scalar type

type Cartesian = T

The remaining channels' scalar types

impl<T, W, A> RelativeEq<Lchab<T, W, A>> for Lchab<T, W, A> where
    T: FreeChannelScalar + RelativeEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + RelativeEq,
    A::Epsilon: Clone + Float,
    W: WhitePoint<T>, 
[src]

impl<T, W, A> StructuralPartialEq for Lchab<T, W, A>[src]

impl<T, W, A> UlpsEq<Lchab<T, W, A>> for Lchab<T, W, A> where
    T: FreeChannelScalar + UlpsEq<Epsilon = A::Epsilon>,
    A: AngularChannelScalar + UlpsEq,
    A::Epsilon: Clone + Float,
    W: WhitePoint<T>, 
[src]

Auto Trait Implementations

impl<T, W, A> RefUnwindSafe for Lchab<T, W, A> where
    A: RefUnwindSafe,
    T: RefUnwindSafe,
    W: RefUnwindSafe

impl<T, W, A> Send for Lchab<T, W, A> where
    A: Send,
    T: Send,
    W: Send

impl<T, W, A> Sync for Lchab<T, W, A> where
    A: Sync,
    T: Sync,
    W: Sync

impl<T, W, A> Unpin for Lchab<T, W, A> where
    A: Unpin,
    T: Unpin,
    W: Unpin

impl<T, W, A> UnwindSafe for Lchab<T, W, A> where
    A: UnwindSafe,
    T: UnwindSafe,
    W: UnwindSafe

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.