pub struct Rectangle {
    pub color: [f32; 4],
    pub shape: Shape,
    pub border: Option<Border>,
}
Expand description

A filled rectangle

Fields

color: [f32; 4]

The rectangle color

shape: Shape

The roundness of the rectangle

border: Option<Border>

The border

Implementations

Creates a new rectangle.

Creates a new rectangle with rounded corners.

Creates a new rectangle border.

Creates a new rectangle border with rounded corners.

Sets color.

Sets shape of the corners.

Sets border properties.

Sets optional border.

Draws the rectangle by corners using the default method.

Draws the rectangle using the default method.

rectangle defines the rectangle’s location and dimensions, draw_state draw state, draw_state::Default::default() can be used as a default, transform is the transformation matrix, g is the Graphics implementation, that is used to actually draw the rectangle.s

Draws the rectangle using triangulation.

This is the default implementation of draw() that will be used if G does not redefine Graphics::rectangle().

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Multiplies with red, green, blue and alpha values.

Rotates hue by radians.

Mixes the current color with white. Read more

Mixes the current color with black. Read more

Rotates hue by degrees.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.