Struct dotrix_core::Color[][src]

pub struct Color {
    pub r: f32,
    pub g: f32,
    pub b: f32,
    pub a: f32,
}
Expand description

RGBA Color.

Fields

r: f32

Red channel. Should be in range from 0 to 1.

g: f32

Green channel. Should be in range from 0 to 1.

b: f32

Blue channel. Should be in range from 0 to 1.

a: f32

Alpha channel. Should be in range from 0 to 1.

Implementations

RGB Constructor, values should be in range from 0 to 1. Alpha will be 1.

RGBA Constructor. Values should be in range from 0 to 1.

Red color (r: 1.0, g: 0.0, b: 0.0)

Grey color

Green color (r: 0.0, g: 1.0, b: 0.0)

Blue color (r: 0.0, g: 0.0, b: 1.0)

Cyan color (r: 0.0, g: 1.0, b: 1.0)

Magenta color (r: 1.0, g: 0.0, b: 1.0)

Yellow color (r: 1.0, g: 1.0, b: 0.0)

White color (r: 1.0, g: 1.0, b: 1.0)

Black color (r: 0.0, g: 0.0, b: 0.0)

Orange color (r: 1.0, g: 0.5, b: 0.0)

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

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Multiply Color by f32. Result is not clamped.

The resulting type after applying the * operator.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more