# `ExRatatui.Widgets.Canvas.Line`
[🔗](https://github.com/mcass19/ex_ratatui/blob/v0.8.2/lib/ex_ratatui/widgets/canvas/line.ex#L1)

A line segment to paint on a `ExRatatui.Widgets.Canvas`.

Coordinates are expressed in the canvas' own coordinate system (the
space defined by `:x_bounds` and `:y_bounds`), not terminal cells.

## Fields

  * `:x1` - starting x coordinate (required)
  * `:y1` - starting y coordinate (required)
  * `:x2` - ending x coordinate (required)
  * `:y2` - ending y coordinate (required)
  * `:color` - `ExRatatui.Style.color()` for the line (required)

## Examples

    iex> alias ExRatatui.Widgets.Canvas.Line
    iex> %Line{x1: 0.0, y1: 0.0, x2: 10.0, y2: 10.0, color: :red}
    %ExRatatui.Widgets.Canvas.Line{
      x1: 0.0,
      y1: 0.0,
      x2: 10.0,
      y2: 10.0,
      color: :red
    }

# `t`

```elixir
@type t() :: %ExRatatui.Widgets.Canvas.Line{
  color: ExRatatui.Style.color(),
  x1: number(),
  x2: number(),
  y1: number(),
  y2: number()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
