# drawLine [Built-ins](README.md) Canonical ID: `graphics.line`. Nederlands: `tekenLijn`. Draws a line between two logical-pixel endpoints using a positive width. Coordinates may be outside the scene; the renderer clips visible work. It is an immediate 2D command, independent of turtle position and heading. Drawing a line does not move the turtle. ## Signature ```text drawLine(x1, y1, x2, y2, width, color) ``` ## Arguments | Parameter | Type | Requirement | |---|---|---| | `x1` | Number | Finite starting x. | | `y1` | Number | Finite starting y. | | `x2` | Number | Finite ending x. | | `y2` | Number | Finite ending y. | | `width` | Number | Finite and greater than 0. | | `color` | Text | Nonempty; use portable English/Dutch names or #RGB/#RRGGBB. | ## Return value `None`. ## Example ```pliro # language: en clearCanvas("white") drawLine(80, 280, 560, 80, 6, "purple") ``` A diagonal purple line. ## Notes and common mistakes Use the function name for your source language. Its [canonical ID](../concepts/canonical-identity.md) is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented [arguments](../concepts/parameters-and-arguments.md) and value types. Pliro reports mismatches when checking can detect them, or when the call runs. A **host** is the app or environment running your program. To see a drawing, it needs a **renderer**, the part that draws on screen. The [command-line](../concepts/command-line.md) command `pliro run` shows text but does not draw these graphics. The [host support table](../guides/hosts.md) explains which effects work in the IDE, browser, native app, and phone preview. A native build reports an unsupported capability instead of leaving it out. 2D uses a 640 × 360 scene with a top-left origin, +X right and +Y down. Both English and Dutch portable color names work in either syntax locale, as do #RGB and #RRGGBB. Other nonempty 2D color text is host-dependent. ## Related entries [clearCanvas](clearCanvas.md) · [rectangle](rectangle.md) · [circle](circle.md) · [drawText](drawText.md) · [Programming guides](../guides/graphics.md) · [Host support](../guides/hosts.md) · [Calls and arguments](../syntax/calls.md)