Enum genpdf::style::Color[][src]

pub enum Color {
    Rgb(u8u8u8),
    Cmyk(u8u8u8u8),
    Greyscale(u8),
}
Expand description

A color, represented by RGB, CMYK or Greyscale values.

For all variants, the possible values range from 0 to 255.

Examples

let red = genpdf::style::Color::Rgb(255, 0, 0);
let cyan = genpdf::style::Color::Cmyk(255, 0, 0, 0);
let grey = genpdf::style::Color::Greyscale(127);

Variants

Rgb(u8u8u8)

An RGB color with red, green and blue values between 0 and 255.

Cmyk(u8u8u8u8)

An CMYK color with cyan, magenta, yellow and key values between 0 and 255.

Greyscale(u8)

A greyscale color with a value between 0 and 255.

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

Performs the conversion.

Performs the conversion.

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.