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

# textColor(at:)

Returns the text color at the index position.

## Declaration

```swift
@nonobjc func textColor(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 text color and range to which it applies.

## See Also

### Accessing colors

- [backgroundColor(at:)](avfoundation/avcaption/backgroundcolor(at:).md)
