Enum conrod_core::color::Color[][src]

pub enum Color {
    Rgba(f32f32f32f32),
    Hsla(f32f32f32f32),
}
Expand description

Color supporting RGB and HSL variants.

Variants

Rgba(f32f32f32f32)

Red, Green, Blue, Alpha - All values’ scales represented between 0.0 and 1.0.

Hsla(f32f32f32f32)

Hue, Saturation, Lightness, Alpha - all values scales represented between 0.0 and 1.0.

Implementations

Produce a complementary color. The two colors will accent each other. This is the same as rotating the hue by 180 degrees.

Calculate and return the luminance of the Color.

Return either black or white, depending which contrasts the Color the most. This will be useful for determining a readable color for text on any given background Color.

Extract the components of a color in the HSL format.

Extract the components of a color in the RGB format.

Extract the components of a color in the RGB format within a fixed-size array.

Same as to_fsa, except r, g, b and a are represented in byte form.

Return the same color but with the given luminance.

Return the same color but with the alpha multiplied by the given alpha.

Return the same color but with the given alpha.

Return a highlighted version of the current Color.

Return a clicked version of the current Color.

Return the Color’s invert.

Return the red value.

Return the green value.

Return the blue value.

Set the red value.

Set the green value.

Set the blue value.

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.

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.