pub type MozFontSmoothingBackgroundColor = AbsoluteColor;
Expand description
The computed value of -moz-font-smoothing-background-color
.
Aliased Type§
struct MozFontSmoothingBackgroundColor {
pub components: ColorComponents,
pub alpha: f32,
pub color_space: ColorSpace,
pub flags: ColorFlags,
}
Fields§
§components: ColorComponents
The 3 components that make up colors in any color space.
alpha: f32
The alpha component of the color.
color_space: ColorSpace
The current color space that the components represent.
flags: ColorFlags
Extra flags used durring serialization of this color.
Implementations§
source§impl AbsoluteColor
impl AbsoluteColor
sourcepub const TRANSPARENT: Self = _
pub const TRANSPARENT: Self = _
A fully transparent color in the legacy syntax.
sourcepub fn new(
color_space: ColorSpace,
c1: impl Into<ComponentDetails>,
c2: impl Into<ComponentDetails>,
c3: impl Into<ComponentDetails>,
alpha: impl Into<ComponentDetails>
) -> Self
pub fn new( color_space: ColorSpace, c1: impl Into<ComponentDetails>, c2: impl Into<ComponentDetails>, c3: impl Into<ComponentDetails>, alpha: impl Into<ComponentDetails> ) -> Self
Create a new AbsoluteColor
with the given ColorSpace
and
components.
sourcepub fn into_srgb_legacy(self) -> Self
pub fn into_srgb_legacy(self) -> Self
Convert this color into the sRGB color space and set it to the legacy syntax.
sourcepub fn srgb_legacy(red: u8, green: u8, blue: u8, alpha: f32) -> Self
pub fn srgb_legacy(red: u8, green: u8, blue: u8, alpha: f32) -> Self
Create a new AbsoluteColor
from rgba legacy syntax values in the sRGB color space.
sourcepub fn raw_components(&self) -> &[f32; 4]
pub fn raw_components(&self) -> &[f32; 4]
Return all the components of the color in an array. (Includes alpha)
sourcepub fn is_legacy_syntax(&self) -> bool
pub fn is_legacy_syntax(&self) -> bool
Returns true if this color is in the legacy color syntax.
sourcepub fn to_color_space(&self, color_space: ColorSpace) -> Self
pub fn to_color_space(&self, color_space: ColorSpace) -> Self
Convert this color to the specified color space.
Trait Implementations§
source§impl Animate for AbsoluteColor
impl Animate for AbsoluteColor
source§impl Clone for AbsoluteColor
impl Clone for AbsoluteColor
source§fn clone(&self) -> AbsoluteColor
fn clone(&self) -> AbsoluteColor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ComputeSquaredDistance for AbsoluteColor
impl ComputeSquaredDistance for AbsoluteColor
source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
source§impl Debug for AbsoluteColor
impl Debug for AbsoluteColor
source§impl MallocSizeOf for AbsoluteColor
impl MallocSizeOf for AbsoluteColor
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
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 PartialEq<AbsoluteColor> for AbsoluteColor
impl PartialEq<AbsoluteColor> for AbsoluteColor
source§fn eq(&self, other: &AbsoluteColor) -> bool
fn eq(&self, other: &AbsoluteColor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToAnimatedValue for AbsoluteColor
impl ToAnimatedValue for AbsoluteColor
§type AnimatedValue = AbsoluteColor
type AnimatedValue = AbsoluteColor
The type of the animated value.
source§fn to_animated_value(self) -> Self
fn to_animated_value(self) -> Self
Converts this value to an animated value.
source§fn from_animated_value(animated: Self::AnimatedValue) -> Self
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§impl ToAnimatedZero for AbsoluteColor
impl ToAnimatedZero for AbsoluteColor
source§fn to_animated_zero(&self) -> Result<Self, ()>
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 ToCss for AbsoluteColor
impl ToCss for AbsoluteColor
source§impl ToResolvedValue for AbsoluteColor
impl ToResolvedValue for AbsoluteColor
§type ResolvedValue = AbsoluteColor
type ResolvedValue = AbsoluteColor
The resolved value type we’re going to be converted to.
source§fn to_resolved_value(self, _: &Context<'_>) -> Self
fn to_resolved_value(self, _: &Context<'_>) -> Self
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.