##### Views

- Page
- Discussion
- View source
- History

# Canvas:clear

Available since LÖVE 0.8.0
It has been renamed from Framebuffer:clear.

Clears content of a Canvas.

When called without arguments, the Canvas will be cleared with color rgba = {0,0,0,0}, i.e. it will be fully transparent. If called with color parameters (be it numbers or a color table), the alpha component may be omitted in which case it defaults to 255 (fully opaque).

It's possible to clear a section of the canvas with love.graphics.setScissor.

## Function

### Synopsis

Canvas:clear( )

### Arguments

None.

### Returns

Nothing.

## Function

### Synopsis

Canvas:clear( red, green, blue, alpha )

### Arguments

`number red`
  Red component of the clear color (0-255).
`number green`
  Green component of the clear color (0-255).
`number blue`
  Blue component of the clear color (0-255).
`number alpha (255)`
  Alpha component of the clear color (0-255).

### Returns

Nothing.

## Function

### Synopsis

Canvas:clear( rgba )

### Arguments

`table rgba`
  A sequence with the red, green, blue and alpha values as numbers (alpha may be ommitted).

### Returns

Nothing.

## See Also

- Canvas

## Other Languages

Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – Tiếng Việt – 한국어
More info

Retrieved from "https://www.love2d.org/wiki/Canvas:clear"
Categories: Templates | Functions

##### Personal tools

- Log in

##### Search

##### Toolbox

- What links here
- Related changes
- Special pages
- Printable version
- Permanent link
- Browse properties