<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaption/textColor(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So9AVCaptionC12AVFoundationE9textColor2atSo10CGColorRefaSg_SnySS5IndexVGtAJ_tF"
  },
  "title" : "textColor(at:)"
}
-->

# textColor(at:)

Returns the text color at the index position.

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

## Parameters

`index`

A character position in the caption text.

## Return Value

A tuple that contains the text color and range to which it applies.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)