Struct nannou_core::color::Lab[][src]

#[repr(C)]
pub struct Lab<Wp = D65, T = f32> where
    T: Component + Float,
    Wp: WhitePoint
{ pub l: T, pub a: T, pub b: T, pub white_point: PhantomData<Wp>, }
Expand description

The CIE L*a*b* (CIELAB) color space.

CIE L*a*b* is a device independent color space which includes all perceivable colors. It’s sometimes used to convert between other color spaces, because of its ability to represent all of their colors, and sometimes in color manipulation, because of its perceptual uniformity. This means that the perceptual difference between two colors is equal to their numerical difference.

The parameters of L*a*b* are quite different, compared to many other color spaces, so manipulating them manually may be unintuitive.

Fields

l: T

L* is the lightness of the color. 0.0 gives absolute black and 100 give the brightest white.

a: T

a* goes from red at -128 to green at 127.

b: T

b* goes from yellow at -128 to blue at 127.

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

CIE L*a*b* with white point D65.

CIE L*a*b*.

Convert to a (L\*, a\*, b\*) tuple.

Convert from a (L\*, a\*, b\*) tuple.

Trait Implementations

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of ApproxEq::abs_diff_eq.

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The scalar type for color components.

Perform a binary operation on this and an other color.

Perform a unary operation on this color.

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Convert from XYZ color space

Convert from L*a*b* color space

Convert from L*C*h° color space

Convert from Yxy color space

Convert from RGB color space

Convert from HSL color space

Convert from HSV color space

Convert from HWB color space

Convert from Luma

The kind of hue unit this color space uses. Read more

Calculate a hue if possible. Read more

Performs the conversion.

Convert into XYZ space

Convert into Yxy color space

Convert into L*a*b* color space

Convert into L*C*h° color space

Convert into RGB color space.

Convert into HSL color space

Convert into HSV color space

Convert into Luma

Convert into HWB color space

Convert self into RGBA.

Check if the color’s components are within the expected ranges.

Return a new color where the components has been clamped to the nearest valid values. Read more

Clamp the color’s components to the nearest valid values.

The type of the mixing factor.

Mix the color with an other color, by factor. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The number of color channels.

Cast as a reference to raw color components.

Cast as a mutable reference to raw color components.

Convert from raw color components.

Cast from a reference to raw color components.

Cast from a mutable reference to raw color components.

Cast a slice of raw color components to a slice of colors. Read more

Cast a mutable slice of raw color components to a mutable slice of colors. Read more

Cast a slice of colors to a slice of raw color components. Read more

Cast a mutable slice of colors to a mutable slice of raw color components. Read more

The default relative tolerance for testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

The inverse of ApproxEq::relative_eq.

Serialize this value into the given Serde serializer. Read more

The type of the lighten/darken amount.

Lighten the color by amount.

Darken the color by amount.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::ulps_eq.

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from T with values clamped to the color defined bounds Read more

Convert from T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Convert from T. The resulting color might be invalid in its color space Read more

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.