Struct color::Luma

source ·
pub struct Luma<T, S = Srgb> {
    pub l: T,
    pub standard: PhantomData<S>,
}

Fields§

§l: T§standard: PhantomData<S>

Implementations§

source§

impl<T, S> Luma<T, S>

source

pub const fn new(l: T) -> Luma<T, S>

source§

impl<T: Channel, S> Luma<T, S>

source

pub fn from_hex(hex: u8) -> Luma<T>

Trait Implementations§

source§

impl<T: Channel + Add<T, Output = T>, S> Add<Luma<T, S>> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Luma<T, S>) -> Luma<T, S>

Performs the + operation. Read more
source§

impl<T: Clone, S> Clone for Luma<T, S>

source§

fn clone(&self) -> Luma<T, S>

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<T: Channel, S> Color<T> for Luma<T, S>

source§

fn clamp_s(self, lo: T, hi: T) -> Luma<T, S>

Clamps the components of the color to the range (lo,hi).

source§

fn clamp_c(self, lo: Luma<T, S>, hi: Luma<T, S>) -> Luma<T, S>

Clamps the components of the color component-wise between lo and hi.

source§

fn inverse(self) -> Luma<T, S>

Inverts the color.

source§

fn mix(self, other: Self, value: T) -> Self

source§

impl<T: Debug, S: Debug> Debug for Luma<T, S>

source§

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

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

impl<'de, T, S> Deserialize<'de> for Luma<T, S>where T: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T: Channel, S> Div<Luma<T, S>> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the / operator.
source§

fn div(self, rhs: Luma<T, S>) -> Luma<T, S>

Performs the / operation. Read more
source§

impl<T: Channel + Div<T, Output = T>, S> Div<T> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Luma<T, S>

Performs the / operation. Read more
source§

impl<T: FloatChannel, S> FloatColor<T> for Luma<T, S>

source§

fn saturate(self) -> Luma<T, S>

Clamps the components of the color to the range (0,1).

source§

impl<T: Channel, S> Mul<Luma<T, S>> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Luma<T, S>) -> Luma<T, S>

Performs the * operation. Read more
source§

impl<T: Channel + Mul<T, Output = T>, S> Mul<T> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Luma<T, S>

Performs the * operation. Read more
source§

impl<N: PartialEq, S> PartialEq<Luma<N, S>> for Luma<N, S>

source§

fn eq(&self, other: &Luma<N, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Channel + Saturating, S> Saturating for Luma<T, S>

source§

fn saturating_add(self, v: Luma<T, S>) -> Luma<T, S>

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
source§

fn saturating_sub(self, v: Luma<T, S>) -> Luma<T, S>

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
source§

impl<T, S> Serialize for Luma<T, S>where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Channel + Sub<T, Output = T>, S> Sub<Luma<T, S>> for Luma<T, S>

§

type Output = Luma<T, S>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Luma<T, S>) -> Luma<T, S>

Performs the - operation. Read more
source§

impl<T: Channel + NumCast + Num, S: TransferFunction> ToHsv for Luma<T, S>

§

type Standard = S

source§

fn to_hsv<U: Channel + NumCast + Num>(&self) -> Hsv<U, S>

source§

impl<T: Channel, S: TransferFunction> ToLuma for Luma<T, S>

§

type Standard = S

source§

fn to_luma<U: Channel>(&self) -> Luma<U, S>

source§

impl<T: Clone + Channel, S: TransferFunction> ToRgb for Luma<T, S>

§

type Standard = S

source§

fn to_rgb<U: Channel>(&self) -> Rgb<U, S>

source§

impl<T: Clone + Channel, S: TransferFunction> ToRgba for Luma<T, S>

§

type Standard = S

source§

fn to_rgba<U: Channel>(&self) -> Rgba<U, S>

source§

impl<T: Copy, S> Copy for Luma<T, S>

source§

impl<N: Clone + PartialEq + Eq + Num + NumCast, S> Eq for Luma<N, S>

Auto Trait Implementations§

§

impl<T, S> RefUnwindSafe for Luma<T, S>where S: RefUnwindSafe, T: RefUnwindSafe,

§

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

§

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

§

impl<T, S> Unpin for Luma<T, S>where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for Luma<T, S>where S: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,