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]

[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.

[src]

Returns a transparent color.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

Trait Implementations

impl Clone for RGBA
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for RGBA
[src]

impl PartialEq for RGBA
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for RGBA
[src]

[src]

Formats the value using the given formatter.

impl ToCss for RGBA
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

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