> For the complete documentation index, see [llms.txt](https://imgo.gitbook.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imgo.gitbook.io/en/api/line.md).

# Line

Draw a line in the image.

## Parameters

<table><thead><tr><th>Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>x1</td><td><code>int</code></td><td>X-Coordinate of one of the endpoint of the line.</td></tr><tr><td>y1</td><td><code>int</code></td><td>Y-Coordinate of one of the endpoint of the line.</td></tr><tr><td>x2</td><td><code>int</code></td><td>X-Coordinate of the other endpoint of the line.</td></tr><tr><td>y2</td><td><code>int</code></td><td>Y-Coordinate of the other endpoint of the line.</td></tr><tr><td>c</td><td><code>color.Color</code></td><td>Color of the line.</td></tr></tbody></table>

## Return Values

The instance of `*imgo.Image` .

## Examples

```go
package main

import (
    "github.com/fishtailstudio/imgo"
    "image/color"
)

func main() {
    imgo.Canvas(300, 300, color.White).
        Line(10, 10, 200, 250, color.Black).
        Save("out.png")
}
```
