> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/browser/canvas/+ext/ctx.point.md).

# ctx.point()

[browser](/web/browser.md) ⟩ [canvas](/web/browser/canvas.md) ⟩ [path](/web/browser/canvas/path.md) ⟩ [curves](/web/browser/canvas/path/curve.md) ⟩ ctx.point()

{% tabs %}
{% tab title="💾 程式" %}
:floppy\_disk: replit：[canvas curves](https://replit.com/@pegasusroe/canvas-curves#script.js)

```javascript
// 🔸 ctx.point()
CanvasRenderingContext2D.prototype.point = function(x, y, {
    color = 'hsl(0 80% 50% / 0.7)',
    radius = 6,
    lineWidth = 2,
} = {}) {

    this.save();

    this.beginPath();
    this.arc(x, y, radius, 0, 2 * Math.PI);

    this.fillStyle = color;
    this.strokeStyle = 'black';
    this.lineWidth = lineWidth;

    this.fill();
    this.stroke();

    this.restore();
};
```

{% endtab %}

{% tab title="⬇️ 應用" %}

* [curves](/web/browser/canvas/path/curve.md)
  {% endtab %}
  {% endtabs %}
