Color

Type Alias Color 

Source
pub type Color = GenericColor<Percentage>;
Expand description

An animated value for <color>.

Aliased Type§

#[repr(C)]
pub enum Color { Absolute(AbsoluteColor), ColorFunction(Box<ColorFunction<GenericColor<Percentage>>>), CurrentColor, ColorMix(Box<GenericColorMix<GenericColor<Percentage>, Percentage>>), ContrastColor(Box<GenericColor<Percentage>>), }

Variants§

§

Absolute(AbsoluteColor)

The actual numeric color.

§

ColorFunction(Box<ColorFunction<GenericColor<Percentage>>>)

A unresolvable color.

§

CurrentColor

The CurrentColor keyword.

§

ColorMix(Box<GenericColorMix<GenericColor<Percentage>, Percentage>>)

The color-mix() function.

§

ContrastColor(Box<GenericColor<Percentage>>)

The contrast-color() function.

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

Source§

fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>

Computes the squared distance between two animatable values.
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