Type Alias style::values::animated::color::Color

source ·
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>

source

pub const TRANSPARENT_BLACK: Self = _

A fully transparent color.

source

pub const BLACK: Self = _

An opaque black color.

source

pub const WHITE: Self = _

An opaque white color.

source

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.

source

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>

source

pub fn as_absolute(&self) -> Option<&AbsoluteColor>

If this color is absolute return it’s value, otherwise return None.

source

pub fn currentcolor() -> Self

Returns a color value representing currentcolor.

source

pub fn is_currentcolor(&self) -> bool

Whether it is a currentcolor value (no numeric color component).

source

pub fn is_absolute(&self) -> bool

Whether this color is an absolute color.

Trait Implementations§

source§

impl Animate for Color

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.
source§

impl<Percentage: Clone> Clone for GenericColor<Percentage>

source§

fn clone(&self) -> GenericColor<Percentage>

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 ComputeSquaredDistance for Color

source§

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>

source§

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

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

impl<Percentage> MallocSizeOf for GenericColor<Percentage>where Percentage: MallocSizeOf,

source§

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>

source§

fn eq(&self, other: &GenericColor<Percentage>) -> 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<Percentage> ToAnimatedValue for GenericColor<Percentage>where Percentage: ToAnimatedValue,

§

type AnimatedValue = GenericColor<<Percentage as ToAnimatedValue>::AnimatedValue>

The type of the animated value.
source§

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

Converts this value to an animated value.
source§

impl ToAnimatedZero for Color

source§

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

impl<Percentage> ToShmem for GenericColor<Percentage>where Percentage: ToShmem,

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

impl<Percentage> StructuralPartialEq for GenericColor<Percentage>