Struct graphics::rectangle::Rectangle [] [src]

pub struct Rectangle {
    pub color: Color,
    pub shape: Shape,
    pub border: Option<Border>,
}

A filled rectangle

Fields

color: Color

The rectangle color

shape: Shape

The roundness of the rectangle

border: Option<Border>

The border

Methods

impl Rectangle
[src]

fn new(color: Color) -> Rectangle

Creates a new rectangle.

fn new_round(color: Color, round_radius: Radius) -> Rectangle

Creates a new round rectangle.

fn new_border(color: Color, radius: Radius) -> Rectangle

Creates a new rectangle border.

fn new_round_border(color: Color, round_radius: Radius, border_radius: Radius) -> Rectangle

Creates a new round rectangle border.

fn color(self, value: Color) -> Self

Sets color.

fn shape(self, value: Shape) -> Self

Sets shape.

fn border(self, value: Border) -> Self

Sets border.

fn maybe_border(self, value: Option<Border>) -> Self

Sets optional border.

fn draw<R: Into<Rectangle>, G>(&self, rectangle: R, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draws the rectangle using default method.

fn draw_tri<R: Into<Rectangle>, G>(&self, rectangle: R, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draws the rectangle using triangulation.

Trait Implementations

impl Colored for Rectangle
[src]

fn mul_rgba(self, r: ColorComponent, g: ColorComponent, b: ColorComponent, a: ColorComponent) -> Self

Multiplies with red, green, blue and alpha values.

fn hue_rad(self, angle: ColorComponent) -> Self

Rotates hue by radians.

fn tint(self, f: ColorComponent) -> Self

Mixes the current color with white. Read more

fn shade(self, f: ColorComponent) -> Self

Mixes the current color with black. Read more

fn hue_deg(self, angle: ColorComponent) -> Self

Rotates hue by degrees.

impl Clone for Rectangle
[src]

fn clone(&self) -> Rectangle

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for Rectangle
[src]