Type Alias style::values::computed::color::ColorMix

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

source

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>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<Color: Debug, Percentage: Debug> Debug for GenericColorMix<Color, Percentage>

source§

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

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

impl<Color, Percentage> MallocSizeOf for GenericColorMix<Color, Percentage>where Color: MallocSizeOf, 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<Color: PartialEq, Percentage: PartialEq> PartialEq<GenericColorMix<Color, Percentage>> for GenericColorMix<Color, Percentage>

source§

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

§

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

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<Color, Percentage> ToComputedValue for GenericColorMix<Color, Percentage>where Color: ToComputedValue, Percentage: ToComputedValue,

§

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

Convert a computed value to specified value form. Read more
source§

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: ToCss, Percentage: ToCss + ToPercentage> ToCss for ColorMix<Color, Percentage>

source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere W: Write,

Serialize self in CSS syntax, writing to dest.
source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
source§

impl<Color, Percentage> ToResolvedValue for GenericColorMix<Color, Percentage>where Color: ToResolvedValue, Percentage: ToResolvedValue,

§

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

Convert a resolved value to resolved value form.
source§

fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue

Convert a resolved value to a resolved value.
source§

impl<Color, Percentage> ToShmem for GenericColorMix<Color, Percentage>where Color: ToShmem, 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<Color, Percentage> StructuralPartialEq for GenericColorMix<Color, Percentage>