pub type Color = GenericColor<Percentage>;
Expand description
A computed value for <color>
.
Aliased Type§
enum Color {
Absolute(AbsoluteColor),
ColorFunction(Box<ColorFunction<GenericColor<Percentage>>>),
CurrentColor,
ColorMix(Box<GenericColorMix<GenericColor<Percentage>, 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.
Implementations§
source§impl Color
impl Color
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.
Trait Implementations§
source§impl ToResolvedValue for Color
impl ToResolvedValue for Color
source§type ResolvedValue = AbsoluteColor
type ResolvedValue = AbsoluteColor
The resolved value type we’re going to be converted to.
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.
source§fn from_resolved_value(resolved: Self::ResolvedValue) -> Self
fn from_resolved_value(resolved: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.