pub type Color = GenericColor<Percentage>;
Expand description
An animated value for <color>
.
Aliased Type§
enum Color {
Absolute(AbsoluteColor),
CurrentColor,
ColorMix(Box<GenericColorMix<GenericColor<Percentage>, Percentage>, Global>),
}
Variants§
Absolute(AbsoluteColor)
The actual numeric color.
CurrentColor
The CurrentColor
keyword.
ColorMix(Box<GenericColorMix<GenericColor<Percentage>, Percentage>, Global>)
The color-mix() function.
Implementations§
source§impl GenericColor<Percentage>
impl GenericColor<Percentage>
sourcepub const TRANSPARENT_BLACK: Self = _
pub const TRANSPARENT_BLACK: Self = _
A fully transparent color.
sourcepub fn from_color_mix(color_mix: ColorMix) -> Self
pub fn from_color_mix(color_mix: ColorMix) -> Self
Create a new computed Color
from a given color-mix, simplifying it to an absolute color
if possible.
sourcepub fn resolve_to_absolute(
&self,
current_color: &AbsoluteColor
) -> AbsoluteColor
pub fn resolve_to_absolute( &self, current_color: &AbsoluteColor ) -> AbsoluteColor
Combine this complex color with the given foreground color into an absolute color.
source§impl<Percentage> Color<Percentage>
impl<Percentage> Color<Percentage>
sourcepub fn as_absolute(&self) -> Option<&AbsoluteColor>
pub fn as_absolute(&self) -> Option<&AbsoluteColor>
If this color is absolute return it’s value, otherwise return None.
sourcepub fn currentcolor() -> Self
pub fn currentcolor() -> Self
Returns a color value representing currentcolor.
sourcepub fn is_currentcolor(&self) -> bool
pub fn is_currentcolor(&self) -> bool
Whether it is a currentcolor value (no numeric color component).
sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Whether this color is an absolute color.
Trait Implementations§
source§impl<Percentage: Clone> Clone for GenericColor<Percentage>
impl<Percentage: Clone> Clone for GenericColor<Percentage>
source§fn clone(&self) -> GenericColor<Percentage>
fn clone(&self) -> GenericColor<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 ComputeSquaredDistance for Color
impl ComputeSquaredDistance for Color
source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
source§impl<Percentage: Debug> Debug for GenericColor<Percentage>
impl<Percentage: Debug> Debug for GenericColor<Percentage>
source§impl<Percentage> MallocSizeOf for GenericColor<Percentage>where
Percentage: MallocSizeOf,
impl<Percentage> MallocSizeOf for GenericColor<Percentage>where 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<Percentage: PartialEq> PartialEq<GenericColor<Percentage>> for GenericColor<Percentage>
impl<Percentage: PartialEq> PartialEq<GenericColor<Percentage>> for GenericColor<Percentage>
source§fn eq(&self, other: &GenericColor<Percentage>) -> bool
fn eq(&self, other: &GenericColor<Percentage>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Percentage> ToAnimatedValue for GenericColor<Percentage>where
Percentage: ToAnimatedValue,
impl<Percentage> ToAnimatedValue for GenericColor<Percentage>where Percentage: ToAnimatedValue,
§type AnimatedValue = GenericColor<<Percentage as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericColor<<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 ToAnimatedZero for Color
impl ToAnimatedZero for Color
source§fn to_animated_zero(&self) -> Result<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying
value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from
the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more