Struct style::values::computed::color::Color [] [src]

pub struct Color {
    pub color: RGBA,
    pub foreground_ratio: u8,
}

This struct represents a combined color from a numeric color and the current foreground color (currentcolor keyword). Conceptually, the formula is "color * (1 - p) + currentcolor * p" where p is foreground_ratio.

Fields

RGBA color.

The ratio of currentcolor in complex color.

Methods

impl Color
[src]

[src]

Returns a numeric color representing the given RGBA value.

[src]

Returns a complex color value representing transparent.

[src]

Returns a complex color value representing currentcolor.

[src]

Whether it is a numeric color (no currentcolor component).

[src]

Whether it is a currentcolor value (no numeric color component).

[src]

Combine this complex color with the given foreground color into a numeric RGBA color. It currently uses linear blending.

Trait Implementations

impl Clone for Color
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Color
[src]

impl Debug for Color
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for Color
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl PartialEq for Color
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl From<RGBA> for Color
[src]

[src]

Performs the conversion.

impl ToCss for Color
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

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

impl ToAnimatedValue for Color
[src]

The type of the animated value.

[src]

Converts this value to an animated value.

[src]

Converts back an animated value into a computed value.