pub type ColorMix = GenericColorMix<Color, Percentage>;
Expand description
A computed color-mix().
Aliased Type§
struct ColorMix {
pub interpolation: ColorInterpolationMethod,
pub left: GenericColor<Percentage>,
pub left_percentage: Percentage,
pub right: GenericColor<Percentage>,
pub right_percentage: Percentage,
pub flags: ColorMixFlags,
}
Fields§
§interpolation: ColorInterpolationMethod
§left: GenericColor<Percentage>
§left_percentage: Percentage
§right: GenericColor<Percentage>
§right_percentage: Percentage
§flags: ColorMixFlags
Implementations§
source§impl<Percentage> ColorMix<GenericColor<Percentage>, Percentage>
impl<Percentage> ColorMix<GenericColor<Percentage>, Percentage>
sourcepub fn mix_to_absolute(&self) -> Option<AbsoluteColor>where
Percentage: ToPercentage,
pub fn mix_to_absolute(&self) -> Option<AbsoluteColor>where Percentage: ToPercentage,
Mix the colors so that we get a single color. If any of the 2 colors are not mixable (perhaps not absolute?), then return None.
Trait Implementations§
source§impl<Color: Clone, Percentage: Clone> Clone for GenericColorMix<Color, Percentage>
impl<Color: Clone, Percentage: Clone> Clone for GenericColorMix<Color, Percentage>
source§fn clone(&self) -> GenericColorMix<Color, Percentage>
fn clone(&self) -> GenericColorMix<Color, Percentage>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Color, Percentage> MallocSizeOf for GenericColorMix<Color, Percentage>where
Color: MallocSizeOf,
Percentage: MallocSizeOf,
impl<Color, Percentage> MallocSizeOf for GenericColorMix<Color, Percentage>where Color: MallocSizeOf, Percentage: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl<Color: PartialEq, Percentage: PartialEq> PartialEq<GenericColorMix<Color, Percentage>> for GenericColorMix<Color, Percentage>
impl<Color: PartialEq, Percentage: PartialEq> PartialEq<GenericColorMix<Color, Percentage>> for GenericColorMix<Color, Percentage>
source§fn eq(&self, other: &GenericColorMix<Color, Percentage>) -> bool
fn eq(&self, other: &GenericColorMix<Color, Percentage>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Color, Percentage> ToAnimatedValue for GenericColorMix<Color, Percentage>where
Color: ToAnimatedValue,
Percentage: ToAnimatedValue,
impl<Color, Percentage> ToAnimatedValue for GenericColorMix<Color, Percentage>where Color: ToAnimatedValue, Percentage: ToAnimatedValue,
§type AnimatedValue = GenericColorMix<<Color as ToAnimatedValue>::AnimatedValue, <Percentage as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericColorMix<<Color as ToAnimatedValue>::AnimatedValue, <Percentage as ToAnimatedValue>::AnimatedValue>
The type of the animated value.
source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§fn to_animated_value(self) -> Self::AnimatedValue
fn to_animated_value(self) -> Self::AnimatedValue
Converts this value to an animated value.
source§impl<Color, Percentage> ToComputedValue for GenericColorMix<Color, Percentage>where
Color: ToComputedValue,
Percentage: ToComputedValue,
impl<Color, Percentage> ToComputedValue for GenericColorMix<Color, Percentage>where Color: ToComputedValue, Percentage: ToComputedValue,
§type ComputedValue = GenericColorMix<<Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue>
type ComputedValue = GenericColorMix<<Color as ToComputedValue>::ComputedValue, <Percentage as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.source§impl<Color, Percentage> ToResolvedValue for GenericColorMix<Color, Percentage>where
Color: ToResolvedValue,
Percentage: ToResolvedValue,
impl<Color, Percentage> ToResolvedValue for GenericColorMix<Color, Percentage>where Color: ToResolvedValue, Percentage: ToResolvedValue,
§type ResolvedValue = GenericColorMix<<Color as ToResolvedValue>::ResolvedValue, <Percentage as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericColorMix<<Color as ToResolvedValue>::ResolvedValue, <Percentage as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.