---
title: "backgroundColor(at:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcaption/backgroundcolor(at:)"
---

# backgroundColor(at:)

Returns the background color at the index position.

## Declaration

```swift
@nonobjc func backgroundColor(at index: String.Index) -> (CGColor?, Range<String.Index>)
```

## Parameters

- `index`: A character position in the caption text.

## Return Value

Return Value A tuple that contains the background color and range to which it applies.

## See Also

### Accessing colors

- [textColor(at:)](avfoundation/avcaption/textcolor(at:).md)
