[go: up one dir, main page]

Struct coolor::Rgb[][src]

pub struct Rgb {
    pub r: u8,
    pub g: u8,
    pub b: u8,
}
Expand description

RGB color, with u8 components

Fields

r: u8

red

g: u8

green

b: u8

blue

Implementations

Create a new RGB color from its components

red part in [0,1]

green part in [0,1]

blue part in [0,1]

Compute the Luma value characterizing the “light” of the color, going from 0 (black) to 1 (white).

Reference: https://en.wikipedia.org/wiki/Luma_(video)

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

Convert from a (r,g,b) float tupples with components in [0,1[

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.