Struct graphics::line::Line [] [src]

pub struct Line {
    pub color: Color,
    pub radius: Radius,
    pub shape: Shape,
}

A colored line with a default border radius

Fields

color: Color

The line color

radius: Radius

The line radius

shape: Shape

The line shape

Methods

impl Line
[src]

fn new(color: Color, radius: Radius) -> Line

Creates a new line

fn new_round(color: Color, radius: Radius) -> Line

Creates a new line

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

Sets color.

fn radius(self, value: Radius) -> Self

Sets radius.

fn width(self, value: Width) -> Self

Sets width.

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

Sets shape.

fn draw<L: Into<Line>, G>(&self, line: L, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draw the line.

fn draw_arrow<L: Into<Line>, G>(&self, line: L, head_size: Scalar, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics

Draws an arrow

Head size is the sides of the triangle between the arrow hooks and the line

Trait Implementations

impl Colored for Line
[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 Line
[src]

fn clone(&self) -> Line

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 Line
[src]