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

source

pub const TRANSPARENT: Self = _

A fully transparent color in the legacy syntax.

source

pub const BLACK: Self = _

An opaque black color in the legacy syntax.

source

pub const WHITE: Self = _

An opaque white color in the legacy syntax.

source

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.

source

pub fn into_srgb_legacy(self) -> Self

Convert this color into the sRGB color space and set it to the legacy syntax.

source

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.

source

pub fn raw_components(&self) -> &[f32; 4]

Return all the components of the color in an array. (Includes alpha)

source

pub fn is_legacy_syntax(&self) -> bool

Returns true if this color is in the legacy color syntax.

source

pub fn alpha(&self) -> f32

Return the alpha component.

source

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

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.
source§

impl Clone for AbsoluteColor

source§

fn clone(&self) -> AbsoluteColor

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

source§

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

Computes the squared distance between two animatable values.
source§

impl Debug for AbsoluteColor

source§

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

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

impl MallocSizeOf for AbsoluteColor

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 PartialEq<AbsoluteColor> for AbsoluteColor

source§

fn eq(&self, other: &AbsoluteColor) -> 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 ToAnimatedValue for AbsoluteColor

§

type AnimatedValue = AbsoluteColor

The type of the animated value.
source§

fn to_animated_value(self) -> Self

Converts this value to an animated value.
source§

fn from_animated_value(animated: Self::AnimatedValue) -> Self

Converts back an animated value into a computed value.
source§

impl ToAnimatedZero for AbsoluteColor

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

impl ToCss for AbsoluteColor

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 ToResolvedValue for AbsoluteColor

§

type ResolvedValue = AbsoluteColor

The resolved value type we’re going to be converted to.
source§

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

Convert a resolved value to a resolved value.
source§

fn from_resolved_value(resolved: Self::ResolvedValue) -> Self

Convert a resolved value to resolved value form.
source§

impl ToShmem for AbsoluteColor

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 Copy for AbsoluteColor

source§

impl StructuralPartialEq for AbsoluteColor