pub type Color = GenericColor<Percentage>;
Expand description
A computed value for <color>
.
Implementations§
source§impl Color
impl 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 transparent() -> Color
pub fn transparent() -> Color
Returns a complex color value representing transparent.
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
§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.