{
"id": "fn-kanvas-line",
"dataComponent": "kanvas",
"heading": {
"title": "line",
"badges": ["Kanvas"]
},
"synopsis": "Draws a straight line between two points using the given color.",
"codeBlocks": [
"extend(\"kanvas\")\n\nwin = kanvas:create([ width:400, height:300 ])\nkanvas:display(win)\n\nkanvas:line(win, [[10,10],[100,80]], \"#00FF00\")\n"
],
"notes": [
"Arguments:",
"- Window handle",
"- Two points: [[x0, y0], [x1, y1]]",
"- Color string (hex)",
"Draws a straight line. Use kanvas:refresh to show changes."
]
}