---
id: "P:cAlgo.API.Control.BackgroundColor"
kind: "property"
type: "T:cAlgo.API.Control"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Control/BackgroundColor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Control.BackgroundColor

Member of [Control](https://help.ctrader.com/ctrader-algo/references/Controls/Control/index.md).

## BackgroundColor

Gets or sets the color of the chart control background.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public Color BackgroundColor {get; set;}
```

Python:

```python
control.BackgroundColor: Color
```

### Returns

`Color` — 

### Examples

C#:

```csharp
var buyButton = new Button { Text = "Buy", BackgroundColor = Color.DarkGreen, ForegroundColor = Color.White };
Chart.AddControl(buyButton);
```

Python:

```python
buyButton = Button()
buyButton.Text = "Buy"
buyButton.BackgroundColor = Color.DarkGreen
buyButton.ForegroundColor = Color.White
api.Chart.AddControl(buyButton)
```

