---
title: "setTextColor(_:in:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablecaption/settextcolor(_:in:)"
---

# setTextColor(_:in:)

Sets the text color for a range of text.

## Declaration

```swift
@nonobjc func setTextColor(_ textColor: CGColor, in range: NSRange)
```

## Parameters

- `textColor`: The text color.
- `range`: The range to which this text color applies.

## See Also

### Configuring colors

- [removeTextColor(in:)](avfoundation/avmutablecaption/removetextcolor(in:).md)
- [setBackgroundColor(_:in:)](avfoundation/avmutablecaption/setbackgroundcolor(_:in:).md)
- [removeBackgroundColor(in:)](avfoundation/avmutablecaption/removebackgroundcolor(in:).md)
