> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/background.md).

# background()

### Example

<figure><img src="/files/1EEw7SBMRPTZphN9uBX2" alt=""><figcaption></figcaption></figure>

```python
background('hotpink')
```

### Syntax

```python
background('NAME')
```

or

```python
background(a,b,c)
```

or

```python
background(VALUE)
```

or

```
background(IMAGE)
```

| Input | Description                                                                                                                                                                |
| ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NAME  | the name of any HTML color, for example: **blue**, **green**, **lightgrey**, **skyblue**, etc...                                                                           |
| a,b,c | RGB or HSB values - see Description below                                                                                                                                  |
| VALUE | a number from 0 - 255, greyscale with 0 being black and 255 being white                                                                                                    |
| IMAGE | variable name of a loaded image (see [loadImage()](/p5-python-web/reference/images-and-audio/loadimage-and-image.md)) to be used as an entire background across the canvas |

### Description

Changes the color of the **background** of the entire canvas. Input can either be the name of an HTML color, a value **0 - 255** for greyscale values with **0 being black** and **255 being white**. Input can also be three numbers for the RGB or HSB color scale - see [colorMode()](/p5-python-web/reference/colour-and-outline/colormode.md). Finally, input can be the name of a loaded **image**, which will be stretched to cover the entire canvs.

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learnpython.strivemath.com/p5-python-web/reference/colour-and-outline/background.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
