[][src]Struct nannou::color::Luma

pub struct Luma<T = f32> where
    T: Float
{ pub luma: T, }

Linear luminance.

Luma is a purely gray scale color space, which is included more for completeness than anything else, and represents how bright a color is perceived to be. It's basically the Y component of CIE XYZ. The lack of any form of hue representation limits the set of operations that can be performed on it.

Fields

luma: T

The lightness of the color. 0.0 is black and 1.0 is white.

Methods

impl<T> Luma<T> where
    T: Float
[src]

pub fn new(luma: T) -> Luma<T>[src]

Linear luminance.

pub fn new_u8(luma: u8) -> Luma<T>[src]

Linear luminance from an 8 bit value.

Trait Implementations

impl<T> IntoColor<T> for Luma<T> where
    T: Float
[src]

fn into_hwb(self) -> Hwb<T>[src]

Convert into HWB color space

impl<T> ComponentWise for Luma<T> where
    T: Float
[src]

type Scalar = T

The scalar type for color components.

impl<T> ApproxEq for Luma<T> where
    T: ApproxEq + Float,
    <T as ApproxEq>::Epsilon: Copy,
    <T as ApproxEq>::Epsilon: Float
[src]

type Epsilon = <T as ApproxEq>::Epsilon

Used for specifying relative comparisons.

impl<T> From<Luma<T>> for Lab<T> where
    T: Float
[src]

impl<T> From<Alpha<Yxy<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Xyz<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Hwb<T>, T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Lab<T>, T> where
    T: Float
[src]

impl<T> From<Alpha<Rgb<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Alpha<Hsl<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Hsl<T>, T> where
    T: Float
[src]

impl<T> From<Alpha<Lch<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Color<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Lch<T>, T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Hsv<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Hsl<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Hsv<T>, T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Yxy<T> where
    T: Float
[src]

impl<T> From<Alpha<Hwb<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Lch<T> where
    T: Float
[src]

impl<T> From<Xyz<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Lab<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Alpha<Hsv<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Alpha<Lab<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Hsv<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Rgb<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Yxy<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Alpha<Luma<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Xyz<T>, T> where
    T: Float
[src]

impl<T> From<Color<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Alpha<Xyz<T>, T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Rgb<T>, T> where
    T: Float
[src]

impl<T> From<Hsl<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Lch<T>> for Luma<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Alpha<Yxy<T>, T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Rgb<T> where
    T: Float
[src]

impl<T> From<Luma<T>> for Hwb<T> where
    T: Float
[src]

impl<T> From<Hwb<T>> for Luma<T> where
    T: Float
[src]

impl<T> Div<T> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the / operator.

impl<T> Div<Luma<T>> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the / operator.

impl<T> Limited for Luma<T> where
    T: Float
[src]

impl<T> Default for Luma<T> where
    T: Float
[src]

impl<T> Mul<T> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the * operator.

impl<T> Mul<Luma<T>> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the * operator.

impl<T> FromColor<T> for Luma<T> where
    T: Float
[src]

fn from_lab(inp: Lab<T>) -> Self[src]

Convert from Lab* color space

fn from_lch(inp: Lch<T>) -> Self[src]

Convert from LCh° color space

fn from_hsl(inp: Hsl<T>) -> Self[src]

Convert from HSL color space

fn from_hsv(inp: Hsv<T>) -> Self[src]

Convert from HSV color space

fn from_hwb(inp: Hwb<T>) -> Self[src]

Convert from HWB color space

impl<T> Shade for Luma<T> where
    T: Float
[src]

type Scalar = T

The type of the lighten/darken amount.

fn darken(&self, amount: Self::Scalar) -> Self[src]

Darken the color by amount.

impl<T> Debug for Luma<T> where
    T: Debug + Float
[src]

impl<T> Copy for Luma<T> where
    T: Copy + Float
[src]

impl<T> Mix for Luma<T> where
    T: Float
[src]

type Scalar = T

The type of the mixing factor.

impl<T> PartialEq<Luma<T>> for Luma<T> where
    T: PartialEq<T> + Float
[src]

impl<T> Add<Luma<T>> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the + operator.

impl<T> Add<T> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the + operator.

impl<T> Sub<T> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the - operator.

impl<T> Sub<Luma<T>> for Luma<T> where
    T: Float
[src]

type Output = Luma<T>

The resulting type after applying the - operator.

impl<T> Blend for Luma<T> where
    T: Float
[src]

type Color = Luma<T>

The core color type. Typically Self for color types without alpha.

fn blend<F>(self, destination: Self, blend_function: F) -> Self where
    F: BlendFunction<Self::Color>, 
[src]

Blend self, as the source color, with destination, using blend_function. Anything that implements BlendFunction is acceptable, including functions and closures. Read more

fn over(self, other: Self) -> Self[src]

Place self over other. This is the good old common alpha composition equation. Read more

fn inside(self, other: Self) -> Self[src]

Results in the parts of self that overlaps the visible parts of other. Read more

fn outside(self, other: Self) -> Self[src]

Results in the parts of self that lies outside the visible parts of other. Read more

fn atop(self, other: Self) -> Self[src]

Place self over only the visible parts of other.

fn xor(self, other: Self) -> Self[src]

Results in either self or other, where they do not overlap.

fn plus(self, other: Self) -> Self[src]

Add self and other. This uses the alpha component to regulate the effect, so it's not just plain component wise addition. Read more

fn multiply(self, other: Self) -> Self[src]

Multiply self with other. This uses the alpha component to regulate the effect, so it's not just plain component wise multiplication. Read more

fn screen(self, other: Self) -> Self[src]

Make a color which is at least as light as self or other.

fn overlay(self, other: Self) -> Self[src]

Multiply self or other if other is dark, or screen them if other is light. This results in an S curve. Read more

fn darken(self, other: Self) -> Self[src]

Return the darkest parts of self and other.

fn lighten(self, other: Self) -> Self[src]

Return the lightest parts of self and other.

fn dodge(self, other: Self) -> Self[src]

Lighten other to reflect self. Results in other if self is black. Read more

fn burn(self, other: Self) -> Self[src]

Darken other to reflect self. Results in other if self is white. Read more

fn hard_light(self, other: Self) -> Self[src]

Multiply self or other if other is dark, or screen them if self is light. This is similar to overlay, but depends on self instead of other. Read more

fn soft_light(self, other: Self) -> Self[src]

Lighten other if self is light, or darken other as if it's burned if self is dark. The effect is increased if the components of self is further from 0.5. Read more

fn difference(self, other: Self) -> Self[src]

Return the absolute difference between self and other. It's basically abs(self - other), but regulated by the alpha component. Read more

fn exclusion(self, other: Self) -> Self[src]

Similar to difference, but appears to result in a lower contrast. other is inverted if self is white, and preserved if self is black. Read more

impl<T> Clone for Luma<T> where
    T: Clone + Float
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<S> IntoRgba<S> for Luma<S> where
    S: Float + One
[src]

Auto Trait Implementations

impl<T> Send for Luma<T> where
    T: Send

impl<T> Sync for Luma<T> where
    T: Sync

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T> Content for T[src]

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

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.