[][src]Enum conrod::color::Color

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

Color supporting RGB and HSL variants.

Variants

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

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

Methods

impl Color
[src]

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

impl PartialEq<Color> for Color
[src]

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

This method tests for !=.

impl From<Color> for Hsla
[src]

Performs the conversion.

impl From<Hsla> for Color
[src]

Performs the conversion.

impl From<Color> for Rgba
[src]

Performs the conversion.

impl From<Rgba> for Color
[src]

Performs the conversion.

impl Clone for Color
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Color
[src]

impl Debug for Color
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Color

impl Sync for Color

Blanket Implementations

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

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

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Content for T where
    T: Copy
[src]

A type that holds a sized version of the content.

Prepares an output buffer, then turns this buffer into an Owned.

Returns the size of each element.

Produces a pointer to the data.

Builds a pointer to this type from a raw pointer.

Returns true if the size is suitable to store a type like this.

impl<T> Erased for T
[src]

impl<T> Downcast for T where
    T: Any
[src]

Convert Box<Trait> (where Trait: Downcast) to Box<Any>. Box<Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any's vtable from &Trait's. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any's vtable from &mut Trait's. Read more