Struct cssparser::RGBA [] [src]

pub struct RGBA {
    pub red: u8,
    pub green: u8,
    pub blue: u8,
    pub alpha: u8,
}

A color with red, green, blue, and alpha components, in a byte each.

Fields

The red component.

The green component.

The blue component.

The alpha component.

Methods

impl RGBA
[src]

Constructs a new RGBA value from float components. It expects the red, green, blue and alpha channels in that order, and all values will be clamped to the 0.0 ... 1.0 range.

Returns a transparent color.

Same thing, but with u8 values instead of floats in the 0 to 1 range.

Returns the red channel in a floating point number form, from 0 to 1.

Returns the green channel in a floating point number form, from 0 to 1.

Returns the blue channel in a floating point number form, from 0 to 1.

Returns the alpha channel in a floating point number form, from 0 to 1.

Trait Implementations

impl Clone for RGBA
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for RGBA
[src]

impl PartialEq for RGBA
[src]

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

This method tests for !=.

impl Debug for RGBA
[src]

Formats the value using the given formatter.

impl ToCss for RGBA
[src]

Serialize self in CSS syntax, writing to dest.

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

Serialize self in CSS syntax and return a result compatible with std::fmt::Show. Read more