cosmic::cosmic_theme::palette

Type Alias Oklaba

source
pub type Oklaba<T = f32> = Alpha<Oklab<T>, T>;
Expand description

Oklab with an alpha component.

Aliased Type§

struct Oklaba<T = f32> {
    pub color: Oklab<T>,
    pub alpha: T,
}

Fields§

§color: Oklab<T>

The color.

§alpha: T

The transparency component. 0.0 (or 0u8) is fully transparent and 1.0 (or 255u8) is fully opaque.

Implementations

source§

impl<C> Alpha<C, <C as Premultiply>::Scalar>
where C: Premultiply,

source

pub fn premultiply(self) -> PreAlpha<C>

Alpha mask the color by its transparency.

source§

impl<C, A> Alpha<C, A>

source

pub fn iter<'a>(&'a self) -> <&'a Alpha<C, A> as IntoIterator>::IntoIter
where &'a Alpha<C, A>: IntoIterator,

Return an iterator over the colors in the wrapped collections.

source

pub fn iter_mut<'a>( &'a mut self, ) -> <&'a mut Alpha<C, A> as IntoIterator>::IntoIter
where &'a mut Alpha<C, A>: IntoIterator,

Return an iterator that allows modifying the colors in the wrapped collections.

source§

impl<C, T> Alpha<C, T>
where T: Stimulus,

source

pub fn min_alpha() -> T

Return the alpha value minimum.

source

pub fn max_alpha() -> T

Return the alpha value maximum.

source§

impl<T, A> Alpha<Oklab<&T>, &A>

source

pub fn copied(&self) -> Alpha<Oklab<T>, A>
where T: Copy, A: Copy,

Get an owned, copied version of this color.

source

pub fn cloned(&self) -> Alpha<Oklab<T>, A>
where T: Clone, A: Clone,

Get an owned, cloned version of this color.

source§

impl<T, A> Alpha<Oklab<&mut T>, &mut A>

source

pub fn set(&mut self, value: Alpha<Oklab<T>, A>)

Update this color with new values.

source

pub fn as_refs(&self) -> Alpha<Oklab<&T>, &A>

Borrow this color’s components as shared references.

source

pub fn copied(&self) -> Alpha<Oklab<T>, A>
where T: Copy, A: Copy,

Get an owned, copied version of this color.

source

pub fn cloned(&self) -> Alpha<Oklab<T>, A>
where T: Clone, A: Clone,

Get an owned, cloned version of this color.

source§

impl<Ct, Ca> Alpha<Oklab<Ct>, Ca>

source

pub fn get<'a, I, T, A>( &'a self, index: I, ) -> Option<Alpha<Oklab<&'a <I as SliceIndex<[T]>>::Output>, &'a <I as SliceIndex<[A]>>::Output>>
where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,

Get a color, or slice of colors, with references to the components at index. See slice::get for details.

source

pub fn get_mut<'a, I, T, A>( &'a mut self, index: I, ) -> Option<Alpha<Oklab<&'a mut <I as SliceIndex<[T]>>::Output>, &'a mut <I as SliceIndex<[A]>>::Output>>
where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,

Get a color, or slice of colors, that allows modifying the components at index. See slice::get_mut for details.

source§

impl<T, A> Alpha<Oklab<T>, A>

Oklaba implementations.

source

pub const fn new(l: T, a: T, b: T, alpha: A) -> Alpha<Oklab<T>, A>

Create an Oklab color with transparency.

source

pub fn into_components(self) -> (T, T, T, A)

Convert to a (L, a, b, alpha) tuple.

source

pub fn from_components(_: (T, T, T, A)) -> Alpha<Oklab<T>, A>

Convert from a (L, a, b, alpha) tuple.

source§

impl<T, A> Alpha<Oklab<Vec<T>>, Vec<A>>

source

pub fn with_capacity(capacity: usize) -> Alpha<Oklab<Vec<T>>, Vec<A>>

Create a struct of vectors with a minimum capacity. See Vec::with_capacity for details.

source

pub fn push(&mut self, value: Alpha<Oklab<T>, A>)

Push an additional color’s components onto the component vectors. See Vec::push for details.

source

pub fn pop(&mut self) -> Option<Alpha<Oklab<T>, A>>

Pop a color’s components from the component vectors. See Vec::pop for details.

source

pub fn clear(&mut self)

Clear the component vectors. See Vec::clear for details.

source

pub fn drain<R>(&mut self, range: R) -> Iter<Iter<Drain<'_, T>>, Drain<'_, A>>
where R: RangeBounds<usize> + Clone,

Return an iterator that moves colors out of the specified range.

Trait Implementations

source§

impl<C, T> AbsDiffEq for Alpha<C, T>
where C: AbsDiffEq<Epsilon = <T as AbsDiffEq>::Epsilon>, T: AbsDiffEq, <T as AbsDiffEq>::Epsilon: Clone,

source§

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> <Alpha<C, T> as AbsDiffEq>::Epsilon

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

fn abs_diff_eq( &self, other: &Alpha<C, T>, epsilon: <T as AbsDiffEq>::Epsilon, ) -> bool

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

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
source§

impl<T, C> Add<T> for Alpha<C, T>
where T: Add + Clone, C: Add<T>,

source§

type Output = Alpha<<C as Add<T>>::Output, <T as Add>::Output>

The resulting type after applying the + operator.
source§

fn add(self, c: T) -> <Alpha<C, T> as Add<T>>::Output

Performs the + operation. Read more
source§

impl<C, T> Add for Alpha<C, T>
where C: Add, T: Add,

source§

type Output = Alpha<<C as Add>::Output, <T as Add>::Output>

The resulting type after applying the + operator.
source§

fn add(self, other: Alpha<C, T>) -> <Alpha<C, T> as Add>::Output

Performs the + operation. Read more
source§

impl<T, C> AddAssign<T> for Alpha<C, T>
where T: AddAssign + Clone, C: AddAssign<T>,

source§

fn add_assign(&mut self, c: T)

Performs the += operation. Read more
source§

impl<C, T> AddAssign for Alpha<C, T>
where C: AddAssign, T: AddAssign,

source§

fn add_assign(&mut self, other: Alpha<C, T>)

Performs the += operation. Read more
source§

impl<C> ArrayCast for Alpha<C, <<C as ArrayCast>::Array as ArrayExt>::Item>
where C: ArrayCast, <C as ArrayCast>::Array: NextArray,

source§

type Array = <<C as ArrayCast>::Array as NextArray>::Next

The output type of a cast to an array.
source§

impl<C, T, const N: usize> AsMut<[T]> for Alpha<C, T>
where Alpha<C, T>: ArrayCast<Array = [T; N]>,

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<C, T, const N: usize> AsMut<[T; N]> for Alpha<C, T>
where Alpha<C, T>: ArrayCast<Array = [T; N]>,

source§

fn as_mut(&mut self) -> &mut [T; N]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<C, T, const N: usize> AsRef<[T]> for Alpha<C, T>
where Alpha<C, T>: ArrayCast<Array = [T; N]>,

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<C, T, const N: usize> AsRef<[T; N]> for Alpha<C, T>
where Alpha<C, T>: ArrayCast<Array = [T; N]>,

source§

fn as_ref(&self) -> &[T; N]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<C, T, const N: usize> Blend for Alpha<C, T>
where C: Premultiply<Scalar = T> + StimulusColor + ArrayCast<Array = [T; N]> + Clone, T: Real + Zero + One + MinMax + Clamp + Sqrt + Abs + Arithmetics + PartialCmp + Clone, <T as HasBoolMask>::Mask: LazySelect<T>,

source§

fn multiply(self, other: Alpha<C, T>) -> Alpha<C, T>

Multiply self with other. This uses the alpha component to regulate the effect, so it’s not just plain component wise multiplication.
source§

fn screen(self, other: Alpha<C, T>) -> Alpha<C, T>

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

fn overlay(self, other: Alpha<C, T>) -> Alpha<C, T>

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

fn darken(self, other: Alpha<C, T>) -> Alpha<C, T>

Return the darkest parts of self and other.
source§

fn lighten(self, other: Alpha<C, T>) -> Alpha<C, T>

Return the lightest parts of self and other.
source§

fn dodge(self, other: Alpha<C, T>) -> Alpha<C, T>

Lighten other to reflect self. Results in other if self is black.
source§

fn burn(self, other: Alpha<C, T>) -> Alpha<C, T>

Darken other to reflect self. Results in other if self is white.
source§

fn hard_light(self, other: Alpha<C, T>) -> Alpha<C, T>

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

fn soft_light(self, other: Alpha<C, T>) -> Alpha<C, T>

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

fn difference(self, other: Alpha<C, T>) -> Alpha<C, T>

Return the absolute difference between self and other. It’s basically abs(self - other), but regulated by the alpha component.
source§

fn exclusion(self, other: Alpha<C, T>) -> Alpha<C, T>

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

impl<C> BlendWith for Alpha<C, <C as Premultiply>::Scalar>
where C: Premultiply,

source§

type Color = C

The base color type of Self.
source§

fn blend_with<F>( self, destination: Alpha<C, <C as Premultiply>::Scalar>, blend_function: F, ) -> Alpha<C, <C as Premultiply>::Scalar>
where F: BlendFunction<<Alpha<C, <C as Premultiply>::Scalar> as BlendWith>::Color>,

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

impl<C, T> Clamp for Alpha<C, T>
where C: Clamp, T: Stimulus + Clamp,

source§

fn clamp(self) -> Alpha<C, T>

Return a new color where out-of-bounds components have been changed to the nearest valid values. Read more
source§

impl<C, T> ClampAssign for Alpha<C, T>

source§

fn clamp_assign(&mut self)

Changes out-of-bounds components to the nearest valid values. Read more
source§

impl<C, T> Clone for Alpha<C, T>
where C: Clone, T: Clone,

source§

fn clone(&self) -> Alpha<C, T>

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, A> Complementary for Alpha<Oklab<T>, A>
where Oklab<T>: Complementary,

source§

fn complementary(self) -> Alpha<Oklab<T>, A>

Return the complementary color of self. Read more
source§

impl<C> Compose for Alpha<C, <C as Premultiply>::Scalar>

source§

fn over( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

Place self over other. This is the good old common alpha composition equation.
source§

fn inside( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

Results in the parts of self that overlaps the visible parts of other.
source§

fn outside( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

Results in the parts of self that lies outside the visible parts of other.
source§

fn atop( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

Place self over only the visible parts of other.
source§

fn xor( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

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

fn plus( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>

Add self and other. This uses the alpha component to regulate the effect, so it’s not just plain component wise addition.
source§

impl<C, T> Debug for Alpha<C, T>
where C: Debug, T: Debug,

source§

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

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

impl<C, T> Default for Alpha<C, T>
where C: Default, T: Stimulus,

source§

fn default() -> Alpha<C, T>

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

impl<C, T> DerefMut for Alpha<C, T>

source§

fn deref_mut(&mut self) -> &mut C

Mutably dereferences the value.
source§

impl<'de, C, T> Deserialize<'de> for Alpha<C, T>
where C: Deserialize<'de>, T: Deserialize<'de>,

source§

fn deserialize<D>( deserializer: D, ) -> Result<Alpha<C, T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl<T, C> Div<T> for Alpha<C, T>
where T: Div + Clone, C: Div<T>,

source§

type Output = Alpha<<C as Div<T>>::Output, <T as Div>::Output>

The resulting type after applying the / operator.
source§

fn div(self, c: T) -> <Alpha<C, T> as Div<T>>::Output

Performs the / operation. Read more
source§

impl<C, T> Div for Alpha<C, T>
where C: Div, T: Div,

source§

type Output = Alpha<<C as Div>::Output, <T as Div>::Output>

The resulting type after applying the / operator.
source§

fn div(self, other: Alpha<C, T>) -> <Alpha<C, T> as Div>::Output

Performs the / operation. Read more
source§

impl<T, C> DivAssign<T> for Alpha<C, T>
where T: DivAssign + Clone, C: DivAssign<T>,

source§

fn div_assign(&mut self, c: T)

Performs the /= operation. Read more
source§

impl<C, T> DivAssign for Alpha<C, T>
where C: DivAssign, T: DivAssign,

source§

fn div_assign(&mut self, other: Alpha<C, T>)

Performs the /= operation. Read more
source§

impl<Tc, Ta, C, A> Extend<Alpha<Tc, Ta>> for Alpha<C, A>
where C: Extend<Tc>, A: Extend<Ta>,

source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = Alpha<Tc, Ta>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, V, const N: usize> From<[Alpha<Oklab<T>, T>; N]> for Alpha<Oklab<V>, V>
where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,

source§

fn from(colors: [Alpha<Oklab<T>, T>; N]) -> Alpha<Oklab<V>, V>

Converts to this type from the input type.
source§

impl<C, T, const N: usize> From<[T; N]> for Alpha<C, T>
where Alpha<C, T>: ArrayCast<Array = [T; N]>,

source§

fn from(array: [T; N]) -> Alpha<C, T>

Converts to this type from the input type.
source§

impl<T, A> From<(T, T, T, A)> for Alpha<Oklab<T>, A>

source§

fn from(components: (T, T, T, A)) -> Alpha<Oklab<T>, A>

Converts to this type from the input type.
source§

impl<C, T> From<C> for Alpha<C, T>
where T: Stimulus,

source§

fn from(color: C) -> Alpha<C, T>

Converts to this type from the input type.
source§

impl<C> From<PreAlpha<C>> for Alpha<C, <C as Premultiply>::Scalar>
where C: Premultiply,

source§

fn from(color: PreAlpha<C>) -> Alpha<C, <C as Premultiply>::Scalar>

Converts to this type from the input type.
source§

impl<C1, C2, T> FromColorUnclamped<C1> for Alpha<C2, T>
where C1: WithAlpha<T>, <C1 as WithAlpha<T>>::Color: IntoColorUnclamped<C2>,

source§

fn from_color_unclamped(other: C1) -> Alpha<C2, T>

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

impl<Tc, Ta, C, A> FromIterator<Alpha<Tc, Ta>> for Alpha<C, A>
where C: Extend<Tc> + FromIterator<Tc>, A: Extend<Ta> + Default,

source§

fn from_iter<T>(iter: T) -> Alpha<C, A>
where T: IntoIterator<Item = Alpha<Tc, Ta>>,

Creates a value from an iterator. Read more
source§

impl<C, T> GetHue for Alpha<C, T>
where C: GetHue,

source§

type Hue = <C as GetHue>::Hue

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

fn get_hue(&self) -> <C as GetHue>::Hue

Calculate a hue if possible. Read more
source§

impl<C, T> HasBoolMask for Alpha<C, T>
where C: HasBoolMask, T: HasBoolMask<Mask = <C as HasBoolMask>::Mask>,

source§

type Mask = <C as HasBoolMask>::Mask

The mask type to use for selecting Self values.
source§

impl<'a, T> IntoIterator for Alpha<Oklab<&'a [T]>, &'a [T]>

source§

type Item = Alpha<Oklab<&'a T>, &'a T>

The type of the elements being iterated over.
source§

type IntoIter = Iter<Iter<Iter<'a, T>>, Iter<'a, T>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Alpha<Oklab<&'a [T]>, &'a [T]> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T> IntoIterator for Alpha<Oklab<&'a mut [T]>, &'a mut [T]>

source§

type Item = Alpha<Oklab<&'a mut T>, &'a mut T>

The type of the elements being iterated over.
source§

type IntoIter = Iter<Iter<IterMut<'a, T>>, IterMut<'a, T>>

Which kind of iterator are we turning this into?
source§

fn into_iter( self, ) -> <Alpha<Oklab<&'a mut [T]>, &'a mut [T]> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Alpha<Oklab<[T; N]>, [T; N]>

source§

type Item = Alpha<Oklab<T>, T>

The type of the elements being iterated over.
source§

type IntoIter = Iter<Iter<IntoIter<T, N>>, IntoIter<T, N>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Alpha<Oklab<[T; N]>, [T; N]> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T> IntoIterator for Alpha<Oklab<Vec<T>>, Vec<T>>

source§

type Item = Alpha<Oklab<T>, T>

The type of the elements being iterated over.
source§

type IntoIter = Iter<Iter<IntoIter<T>>, IntoIter<T>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Alpha<Oklab<Vec<T>>, Vec<T>> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<C, T> IsWithinBounds for Alpha<C, T>
where C: IsWithinBounds, T: Stimulus + PartialCmp<Mask = <C as HasBoolMask>::Mask> + IsWithinBounds, <C as HasBoolMask>::Mask: BitAnd<Output = <C as HasBoolMask>::Mask>,

source§

fn is_within_bounds(&self) -> <C as HasBoolMask>::Mask

Check if the color’s components are within the expected range bounds. Read more
source§

impl<C> Lighten for Alpha<C, <C as Lighten>::Scalar>
where C: Lighten,

source§

type Scalar = <C as Lighten>::Scalar

The type of the lighten modifier.
source§

fn lighten( self, factor: <C as Lighten>::Scalar, ) -> Alpha<C, <C as Lighten>::Scalar>

Scale the color towards the maximum lightness by factor, a value ranging from 0.0 to 1.0. Read more
source§

fn lighten_fixed( self, amount: <C as Lighten>::Scalar, ) -> Alpha<C, <C as Lighten>::Scalar>

Lighten the color by amount, a value ranging from 0.0 to 1.0. Read more
source§

impl<C> LightenAssign for Alpha<C, <C as LightenAssign>::Scalar>
where C: LightenAssign,

source§

type Scalar = <C as LightenAssign>::Scalar

The type of the lighten modifier.
source§

fn lighten_assign(&mut self, factor: <C as LightenAssign>::Scalar)

Scale the color towards the maximum lightness by factor, a value ranging from 0.0 to 1.0. Read more
source§

fn lighten_fixed_assign(&mut self, amount: <C as LightenAssign>::Scalar)

Lighten the color by amount, a value ranging from 0.0 to 1.0. Read more
source§

impl<C, T> LowerHex for Alpha<C, T>
where T: LowerHex, C: LowerHex,

source§

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

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

impl<C> Mix for Alpha<C, <C as Mix>::Scalar>
where C: Mix, <C as Mix>::Scalar: Zero + One + Clamp + Arithmetics + Clone,

source§

type Scalar = <C as Mix>::Scalar

The type of the mixing factor.
source§

fn mix( self, other: Alpha<C, <C as Mix>::Scalar>, factor: <C as Mix>::Scalar, ) -> Alpha<C, <C as Mix>::Scalar>

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

impl<C> MixAssign for Alpha<C, <C as MixAssign>::Scalar>

source§

type Scalar = <C as MixAssign>::Scalar

The type of the mixing factor.
source§

fn mix_assign( &mut self, other: Alpha<C, <C as MixAssign>::Scalar>, factor: <C as MixAssign>::Scalar, )

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

impl<T, C> Mul<T> for Alpha<C, T>
where T: Mul + Clone, C: Mul<T>,

source§

type Output = Alpha<<C as Mul<T>>::Output, <T as Mul>::Output>

The resulting type after applying the * operator.
source§

fn mul(self, c: T) -> <Alpha<C, T> as Mul<T>>::Output

Performs the * operation. Read more
source§

impl<C, T> Mul for Alpha<C, T>
where C: Mul, T: Mul,

source§

type Output = Alpha<<C as Mul>::Output, <T as Mul>::Output>

The resulting type after applying the * operator.
source§

fn mul(self, other: Alpha<C, T>) -> <Alpha<C, T> as Mul>::Output

Performs the * operation. Read more
source§

impl<T, C> MulAssign<T> for Alpha<C, T>
where T: MulAssign + Clone, C: MulAssign<T>,

source§

fn mul_assign(&mut self, c: T)

Performs the *= operation. Read more
source§

impl<C, T> MulAssign for Alpha<C, T>
where C: MulAssign, T: MulAssign,

source§

fn mul_assign(&mut self, other: Alpha<C, T>)

Performs the *= operation. Read more
source§

impl<C, T> PartialEq for Alpha<C, T>
where T: PartialEq, C: PartialEq,

source§

fn eq(&self, other: &Alpha<C, T>) -> bool

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

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

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

impl<C, T> RelativeEq for Alpha<C, T>
where C: RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon>, T: RelativeEq, <T as AbsDiffEq>::Epsilon: Clone,

source§

fn default_max_relative() -> <Alpha<C, T> as AbsDiffEq>::Epsilon

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

fn relative_eq( &self, other: &Alpha<C, T>, epsilon: <Alpha<C, T> as AbsDiffEq>::Epsilon, max_relative: <Alpha<C, T> as AbsDiffEq>::Epsilon, ) -> bool

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

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
source§

impl<C> Saturate for Alpha<C, <C as Saturate>::Scalar>
where C: Saturate,

source§

type Scalar = <C as Saturate>::Scalar

The type of the saturation modifier.
source§

fn saturate( self, factor: <C as Saturate>::Scalar, ) -> Alpha<C, <C as Saturate>::Scalar>

Scale the color towards the maximum saturation by factor, a value ranging from 0.0 to 1.0. Read more
source§

fn saturate_fixed( self, amount: <C as Saturate>::Scalar, ) -> Alpha<C, <C as Saturate>::Scalar>

Increase the saturation by amount, a value ranging from 0.0 to 1.0. Read more
source§

impl<C> SaturateAssign for Alpha<C, <C as SaturateAssign>::Scalar>
where C: SaturateAssign,

source§

type Scalar = <C as SaturateAssign>::Scalar

The type of the saturation modifier.
source§

fn saturate_assign(&mut self, factor: <C as SaturateAssign>::Scalar)

Scale the color towards the maximum saturation by factor, a value ranging from 0.0 to 1.0. Read more
source§

fn saturate_fixed_assign(&mut self, amount: <C as SaturateAssign>::Scalar)

Increase the saturation by amount, a value ranging from 0.0 to 1.0. Read more
source§

impl<T, C> SaturatingAdd<T> for Alpha<C, T>
where T: SaturatingAdd + Clone, C: SaturatingAdd<T>,

source§

type Output = Alpha<<C as SaturatingAdd<T>>::Output, <T as SaturatingAdd>::Output>

The resulting type.
source§

fn saturating_add(self, c: T) -> <Alpha<C, T> as SaturatingAdd<T>>::Output

Returns the sum of self and other, but saturates instead of overflowing.
source§

impl<C, T> SaturatingAdd for Alpha<C, T>

source§

type Output = Alpha<<C as SaturatingAdd>::Output, <T as SaturatingAdd>::Output>

The resulting type.
source§

fn saturating_add( self, other: Alpha<C, T>, ) -> <Alpha<C, T> as SaturatingAdd>::Output

Returns the sum of self and other, but saturates instead of overflowing.
source§

impl<T, C> SaturatingSub<T> for Alpha<C, T>
where T: SaturatingSub + Clone, C: SaturatingSub<T>,

source§

type Output = Alpha<<C as SaturatingSub<T>>::Output, <T as SaturatingSub>::Output>

The resulting type.
source§

fn saturating_sub(self, c: T) -> <Alpha<C, T> as SaturatingSub<T>>::Output

Returns the difference of self and other, but saturates instead of overflowing.
source§

impl<C, T> SaturatingSub for Alpha<C, T>

source§

type Output = Alpha<<C as SaturatingSub>::Output, <T as SaturatingSub>::Output>

The resulting type.
source§

fn saturating_sub( self, other: Alpha<C, T>, ) -> <Alpha<C, T> as SaturatingSub>::Output

Returns the difference of self and other, but saturates instead of overflowing.
source§

impl<C, T> Serialize for Alpha<C, T>
where C: Serialize, T: Serialize,

source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

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

impl<C, T, H> SetHue<H> for Alpha<C, T>
where C: SetHue<H>,

source§

fn set_hue(&mut self, hue: H)

Change the hue to a specific value.
source§

impl<C, T> ShiftHue for Alpha<C, T>
where C: ShiftHue,

source§

type Scalar = <C as ShiftHue>::Scalar

The type of the hue modifier.
source§

fn shift_hue(self, amount: <Alpha<C, T> as ShiftHue>::Scalar) -> Alpha<C, T>

Return a copy of self with the hue shifted by amount.
source§

impl<C, T> ShiftHueAssign for Alpha<C, T>
where C: ShiftHueAssign,

source§

type Scalar = <C as ShiftHueAssign>::Scalar

The type of the hue modifier.
source§

fn shift_hue_assign(&mut self, amount: <Alpha<C, T> as ShiftHueAssign>::Scalar)

Shifts the hue by amount.
source§

impl<T, C> Sub<T> for Alpha<C, T>
where T: Sub + Clone, C: Sub<T>,

source§

type Output = Alpha<<C as Sub<T>>::Output, <T as Sub>::Output>

The resulting type after applying the - operator.
source§

fn sub(self, c: T) -> <Alpha<C, T> as Sub<T>>::Output

Performs the - operation. Read more
source§

impl<C, T> Sub for Alpha<C, T>
where C: Sub, T: Sub,

source§

type Output = Alpha<<C as Sub>::Output, <T as Sub>::Output>

The resulting type after applying the - operator.
source§

fn sub(self, other: Alpha<C, T>) -> <Alpha<C, T> as Sub>::Output

Performs the - operation. Read more
source§

impl<T, C> SubAssign<T> for Alpha<C, T>
where T: SubAssign + Clone, C: SubAssign<T>,

source§

fn sub_assign(&mut self, c: T)

Performs the -= operation. Read more
source§

impl<C, T> SubAssign for Alpha<C, T>
where C: SubAssign, T: SubAssign,

source§

fn sub_assign(&mut self, other: Alpha<C, T>)

Performs the -= operation. Read more
source§

impl<T, A> Tetradic for Alpha<Oklab<T>, A>
where Oklab<T>: Tetradic, A: Clone,

source§

fn tetradic( self, ) -> (Alpha<Oklab<T>, A>, Alpha<Oklab<T>, A>, Alpha<Oklab<T>, A>)

Return the three additional colors of a tetradic color scheme. Read more
source§

impl<C, T> UlpsEq for Alpha<C, T>
where C: UlpsEq<Epsilon = <T as AbsDiffEq>::Epsilon>, T: UlpsEq, <T as AbsDiffEq>::Epsilon: Clone,

source§

fn default_max_ulps() -> u32

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

fn ulps_eq( &self, other: &Alpha<C, T>, epsilon: <Alpha<C, T> as AbsDiffEq>::Epsilon, max_ulps: u32, ) -> bool

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

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
source§

impl<C, T> UpperHex for Alpha<C, T>
where T: UpperHex, C: UpperHex,

source§

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

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

impl<C, A> WithAlpha<A> for Alpha<C, A>

source§

type Color = C

The opaque color type, without any transparency. Read more
source§

type WithAlpha = Alpha<C, A>

The color type with transparency applied. Read more
source§

fn with_alpha(self, alpha: A) -> <Alpha<C, A> as WithAlpha<A>>::WithAlpha

Transforms the color into a transparent color with the provided alpha value. If Self already has a transparency, it is overwritten. Read more
source§

fn without_alpha(self) -> <Alpha<C, A> as WithAlpha<A>>::Color

Removes the transparency from the color. If Self::Color has an internal transparency field, that field will be set to A::max_intensity() to make it opaque. Read more
source§

fn split(self) -> (<Alpha<C, A> as WithAlpha<A>>::Color, A)

Splits the color into separate color and transparency values. Read more
source§

impl<C, T, H> WithHue<H> for Alpha<C, T>
where C: WithHue<H>,

source§

fn with_hue(self, hue: H) -> Alpha<C, T>

Return a copy of self with a specific hue.
source§

impl<C, T> Deref for Alpha<C, T>

source§

type Target = C

The resulting type after dereferencing.
source§

fn deref(&self) -> &C

Dereferences the value.
source§

impl<C, T> Copy for Alpha<C, T>
where C: Copy, T: Copy,

source§

impl<C, T> Eq for Alpha<C, T>
where T: Eq, C: Eq,