# Alpha in maplibre::style - Rust
A color with an alpha component.
Keywords: rust, rustlang, rust-lang, Alpha

# Struct maplibre::style::Alpha

[−]

    pub struct Alpha<ColorTy> where
        ColorTy: ColorStruct,  {
        pub color: ColorTy,
        pub alpha: <ColorTy as ColorStruct>::ComponentTy,
    }

Expand description

A color with an alpha component.

The color components and alpha component are completely separate.

## Fields

`color: ColorTy`

The contained color, which is completely separate from the `alpha` value.

`alpha: <ColorTy as ColorStruct>::ComponentTy`

The alpha component.

## Trait Implementations

### impl<ColorTy> Clone for Alpha<ColorTy> where
ColorTy: Clone + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Clone,

#### pub fn clone(&self) -> Alpha<ColorTy>

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

### impl<ColorTy> Debug for Alpha<ColorTy> where
ColorTy: Debug + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Debug,

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

Formats the value using the given formatter. Read more

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<CieXYZ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<CieXYZ<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Oklab<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Oklab<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<AcesCg<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<AcesCg<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<DisplayP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<DisplayP3<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedBt2100PQ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedBt2100PQ<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<ICtCpPQ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<ICtCpPQ<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Aces2065<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Aces2065<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<GenericColor<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<GenericColor<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<DciXYZPrime<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<DciXYZPrime<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Oklch<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Oklch<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<DciP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<DciP3<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Bt2100<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Bt2100<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedSrgb<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedSrgb<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedBt2020<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedBt2020<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedBt2100HLG<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedBt2100HLG<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<CieLab<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<CieLab<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Hsv<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Hsv<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Rec709<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Rec709<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Bt2020<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Bt2020<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<CieLCh<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<CieLCh<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<AcesCc<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<AcesCc<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<ICtCpHLG<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<ICtCpHLG<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<Hsl<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<Hsl<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedRec709<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedRec709<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<LinearSrgb<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<LinearSrgb<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<EncodedDisplayP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<EncodedDisplayP3<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<[ComponentTy; 4]> for Alpha<AcesCct<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn from([ComponentTy; 4]) -> Alpha<AcesCct<ComponentTy>>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Aces2065<ComponentTy>>> for Aces2065<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Aces2065<ComponentTy>>) -> Aces2065<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<AcesCc<ComponentTy>>> for AcesCc<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<AcesCc<ComponentTy>>) -> AcesCc<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<AcesCct<ComponentTy>>> for AcesCct<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<AcesCct<ComponentTy>>) -> AcesCct<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<AcesCg<ComponentTy>>> for AcesCg<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<AcesCg<ComponentTy>>) -> AcesCg<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Bt2020<ComponentTy>>> for Bt2020<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Bt2020<ComponentTy>>) -> Bt2020<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Bt2100<ComponentTy>>> for Bt2100<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Bt2100<ComponentTy>>) -> Bt2100<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<CieLCh<ComponentTy>>> for CieLCh<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<CieLCh<ComponentTy>>) -> CieLCh<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<CieLab<ComponentTy>>> for CieLab<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<CieLab<ComponentTy>>) -> CieLab<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<CieXYZ<ComponentTy>>> for CieXYZ<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<CieXYZ<ComponentTy>>) -> CieXYZ<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<DciP3<ComponentTy>>> for DciP3<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<DciP3<ComponentTy>>) -> DciP3<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<DciXYZPrime<ComponentTy>>> for DciXYZPrime<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<DciXYZPrime<ComponentTy>>
) -> DciXYZPrime<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<DisplayP3<ComponentTy>>> for DisplayP3<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<DisplayP3<ComponentTy>>) -> DisplayP3<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedBt2020<ComponentTy>>> for EncodedBt2020<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedBt2020<ComponentTy>>
) -> EncodedBt2020<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedBt2100HLG<ComponentTy>>> for EncodedBt2100HLG<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedBt2100HLG<ComponentTy>>
) -> EncodedBt2100HLG<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedBt2100PQ<ComponentTy>>> for EncodedBt2100PQ<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedBt2100PQ<ComponentTy>>
) -> EncodedBt2100PQ<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedDisplayP3<ComponentTy>>> for EncodedDisplayP3<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedDisplayP3<ComponentTy>>
) -> EncodedDisplayP3<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedRec709<ComponentTy>>> for EncodedRec709<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedRec709<ComponentTy>>
) -> EncodedRec709<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<EncodedSrgb<ComponentTy>>> for EncodedSrgb<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<EncodedSrgb<ComponentTy>>
) -> EncodedSrgb<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<GenericColor<ComponentTy>>> for GenericColor<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<GenericColor<ComponentTy>>
) -> GenericColor<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Hsl<ComponentTy>>> for Hsl<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Hsl<ComponentTy>>) -> Hsl<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Hsv<ComponentTy>>> for Hsv<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Hsv<ComponentTy>>) -> Hsv<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<ICtCpHLG<ComponentTy>>> for ICtCpHLG<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<ICtCpHLG<ComponentTy>>) -> ICtCpHLG<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<ICtCpPQ<ComponentTy>>> for ICtCpPQ<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<ICtCpPQ<ComponentTy>>) -> ICtCpPQ<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<LinearSrgb<ComponentTy>>> for LinearSrgb<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(
col_alpha: Alpha<LinearSrgb<ComponentTy>>
) -> LinearSrgb<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Oklab<ComponentTy>>> for Oklab<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Oklab<ComponentTy>>) -> Oklab<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Oklch<ComponentTy>>> for Oklch<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Oklch<ComponentTy>>) -> Oklch<ComponentTy>

Performs the conversion.

### impl<ComponentTy> From<Alpha<Rec709<ComponentTy>>> for Rec709<ComponentTy> where
ComponentTy: Clone + Copy,

#### pub fn from(col_alpha: Alpha<Rec709<ComponentTy>>) -> Rec709<ComponentTy>

Performs the conversion.

### impl From<Color> for Alpha<EncodedSrgb<u8>>

#### pub fn from(c: Color) -> Alpha<EncodedSrgb<u8>>

Performs the conversion.

### impl From<Color> for Alpha<EncodedSrgb<f32>>

#### pub fn from(c: Color) -> Alpha<EncodedSrgb<f32>>

Performs the conversion.

### impl From<Color> for Alpha<EncodedSrgb<f64>>

#### pub fn from(c: Color) -> Alpha<EncodedSrgb<f64>>

Performs the conversion.

### impl<ColorTy> Hash for Alpha<ColorTy> where
ColorTy: Hash + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Hash,

#### pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,

Feeds this value into the given `Hasher`. Read more

1.3.0 · source

#### fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,

Feeds a slice of this type into the given `Hasher`. Read more

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedBt2020<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Bt2100<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Hsv<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<ICtCpHLG<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedBt2100PQ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<ICtCpPQ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<AcesCg<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<GenericColor<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<AcesCc<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedBt2100HLG<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<CieLCh<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Bt2020<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<AcesCct<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedDisplayP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Aces2065<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedSrgb<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<CieLab<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<LinearSrgb<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<DciP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Oklab<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<CieXYZ<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<EncodedRec709<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Rec709<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Oklch<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<DciXYZPrime<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<Hsl<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ComponentTy> Into<[ComponentTy; 4]> for Alpha<DisplayP3<ComponentTy>> where
ComponentTy: Clone + Copy,

#### pub fn into(self) -> [ComponentTy; 4]

Performs the conversion.

### impl<ColorTy> Ord for Alpha<ColorTy> where
ColorTy: Ord + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Ord,

#### pub fn cmp(&self, other: &Alpha<ColorTy>) -> Ordering

This method returns an `Ordering` between `self` and `other`. Read more

1.21.0 · source

#### fn max(self, other: Self) -> Self

Compares and returns the maximum of two values. Read more

1.21.0 · source

#### fn min(self, other: Self) -> Self

Compares and returns the minimum of two values. Read more

1.50.0 · source

#### fn clamp(self, min: Self, max: Self) -> Self

Restrict a value to a certain interval. Read more

### impl<ColorTy> PartialEq<Alpha<ColorTy>> for Alpha<ColorTy> where
ColorTy: PartialEq<ColorTy> + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: PartialEq<<ColorTy as ColorStruct>::ComponentTy>,

#### pub fn eq(&self, other: &Alpha<ColorTy>) -> bool

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

#### pub fn ne(&self, other: &Alpha<ColorTy>) -> bool

This method tests for `!=`.

### impl<ColorTy> PartialOrd<Alpha<ColorTy>> for Alpha<ColorTy> where
ColorTy: PartialOrd<ColorTy> + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: PartialOrd<<ColorTy as ColorStruct>::ComponentTy>,

#### pub fn partial_cmp(&self, other: &Alpha<ColorTy>) -> Option<Ordering>

This method returns an ordering between `self` and `other` values if one exists. Read more

1.0.0 · source

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

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

1.0.0 · source

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

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

1.0.0 · source

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

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

1.0.0 · source

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

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### impl<ColorTy> Copy for Alpha<ColorTy> where
ColorTy: Copy + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Copy,

### impl<ColorTy> Eq for Alpha<ColorTy> where
ColorTy: Eq + ColorStruct,
<ColorTy as ColorStruct>::ComponentTy: Eq,

### impl<ColorTy> StructuralEq for Alpha<ColorTy> where
ColorTy: ColorStruct,

### impl<ColorTy> StructuralPartialEq for Alpha<ColorTy> where
ColorTy: ColorStruct,

## Auto Trait Implementations

### impl<ColorTy> RefUnwindSafe for Alpha<ColorTy> where
ColorTy: RefUnwindSafe,
<ColorTy as ColorStruct>::ComponentTy: RefUnwindSafe,

### impl<ColorTy> Send for Alpha<ColorTy> where
ColorTy: Send,
<ColorTy as ColorStruct>::ComponentTy: Send,

### impl<ColorTy> Sync for Alpha<ColorTy> where
ColorTy: Sync,
<ColorTy as ColorStruct>::ComponentTy: Sync,

### impl<ColorTy> Unpin for Alpha<ColorTy> where
ColorTy: Unpin,
<ColorTy as ColorStruct>::ComponentTy: Unpin,

### impl<ColorTy> UnwindSafe for Alpha<ColorTy> where
ColorTy: UnwindSafe,
<ColorTy as ColorStruct>::ComponentTy: UnwindSafe,

## Blanket Implementations

source

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

source

#### pub fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

source

### impl<T> Borrow<T> for T where
T: ?Sized,

const: unstable · source

#### pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

source

### impl<T> BorrowMut<T> for T where
T: ?Sized,

const: unstable · source

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

Mutably borrows from an owned value. Read more

### impl<T> CallHasher for T where
T: Hash + ?Sized,

#### pub fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
H: Hash + ?Sized,
B: BuildHasher,

### impl<T> Downcast for T where
T: Any,

#### pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Convert `Box<dyn Trait>` (where `Trait: Downcast`) to `Box<dyn Any>`. `Box<dyn Any>` can then be further `downcast` into `Box<ConcreteType>` where `ConcreteType` implements `Trait`. Read more

#### pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

Convert `Rc<Trait>` (where `Trait: Downcast`) to `Rc<Any>`. `Rc<Any>` can then be further `downcast` into `Rc<ConcreteType>` where `ConcreteType` implements `Trait`. Read more

#### pub fn as_any(&self) -> &(dyn Any + 'static)

Convert `&Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&Any`’s vtable from `&Trait`’s. Read more

#### pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert `&mut Trait` (where `Trait: Downcast`) to `&Any`. This is needed since Rust cannot generate `&mut Any`’s vtable from `&mut Trait`’s. Read more

### impl<T> Downcast<T> for T

#### pub fn downcast(&self) -> &T

### impl<T> DowncastSync for T where
T: Any + Send + Sync,

#### pub fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync + 'static>

Convert `Arc<Trait>` (where `Trait: Downcast`) to `Arc<Any>`. `Arc<Any>` can then be further `downcast` into `Arc<ConcreteType>` where `ConcreteType` implements `Trait`. Read more

source

### impl<T> DynEq for T where
T: Any + Eq,

source

#### fn as_any(&self) -> &dyn Any

source

#### fn dyn_eq(&self, other: &dyn DynEq) -> bool

source

### impl<T> DynHash for T where
T: DynEq + Hash,

source

#### fn as_dyn_eq(&self) -> &dyn DynEq

source

#### fn dyn_hash(&self, state: &mut dyn Hasher)

source

### impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,

source

#### pub fn equivalent(&self, key: &K) -> bool

Compare self to `key` and return `true` if they are equal.

source

### impl<T> From<T> for T

const: unstable · source

#### pub fn from(t: T) -> T

Returns the argument unchanged.

source

### impl<T> Instrument for T

source

#### fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided `Span`, returning an `Instrumented` wrapper. Read more

source

#### fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current `Span`, returning an `Instrumented` wrapper. Read more

source

### impl<T, U> Into<U> for T where
U: From<T>,

const: unstable · source

#### pub 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> Same<T> for T

#### type Output = T

Should always be `Self`

source

### impl<T> ToOwned for T where
T: Clone,

#### type Owned = T

The resulting type after obtaining ownership.

source

#### pub fn to_owned(&self) -> T

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

source

#### pub fn clone_into(&self, target: &mut T)

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

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

source

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

The type returned in the event of a conversion error.

const: unstable · source

#### pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

source

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

const: unstable · source

#### pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

### impl<T> Upcast<T> for T

#### pub fn upcast(&self) -> Option<&T>

source

### impl<T> WithSubscriber for T

source

#### fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,

Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more

source

#### fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more