---
name: "CanvasContext.fill"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "fill"
---

## CanvasContext.fill

> [VERSION] Base Library >= 2.21.8

### Description

Fill the current path

### Parameters

None


### Return Value

None


### Examples

#### Fill the path

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.beginPath();
ctx.moveTo(10, 10);
ctx.lineTo(100, 10);
ctx.lineTo(100, 100);
ctx.closePath();
ctx.setFillStyle('#ff0000');
ctx.fill();
ctx.draw();
```
