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

The line color

radius

The line radius

shape

The line shape

Methods

impl Line

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

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

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

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

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

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

Derived Implementations

impl Clone for Line

fn clone(&self) -> Line

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

impl Copy for Line