Enum hvif::style::Colour[][src]

pub enum Colour {
    Rgba(u8u8u8u8),
    Rgb(u8u8u8),
    Grey(u8u8),
    GreyNoAlpha(u8),
}
Expand description

Represents one colour, with optimisations in the cases there is no alpha, or all three components are equal (that is, grey).

Variants

Rgba(u8u8u8u8)

Contains all four components.

Tuple Fields of Rgba

0: u81: u82: u83: u8
Rgb(u8u8u8)

Completely opaque RGB.

Tuple Fields of Rgb

0: u81: u82: u8
Grey(u8u8)

All three colours are equal.

Tuple Fields of Grey

0: u81: u8
GreyNoAlpha(u8)

Completely opaque grey.

Tuple Fields of GreyNoAlpha

0: u8

Implementations

Returns whether a colour is opaque, that is no alpha value is present.

Converts this colour to its rgb components.

Safety: it must be called only on opaque colours.

Converts this colour to its rgba components.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.