---
title: color
framework: pdfkit
role: symbol
role_heading: Instance Property
path: pdfkit/pdfselection/color
---

# color

Sets the color used for the drawing of a selection in both active and inactive states.

## Declaration

```swift
@NSCopying var color: UIColor? { get set }
```

```swift
@NSCopying var color: NSColor? { get set }
```

## Discussion

Discussion When no color has been specified for the PDFSelection objects in a document, the selections are drawn using [NSColor selectedTextBackgroundColor] for the active state and [NSColor secondarySelectedControlColor] for the inactive state. Use the setColor method to supply a color you want to be used for the drawing of both active and inactive selections.

## See Also

### Related Documentation

- [PDFSelection](pdfkit/pdfselection.md)

### Getting Information About a Selection

- [pages](pdfkit/pdfselection/pages.md)
- [string](pdfkit/pdfselection/string.md)
- [attributedString](pdfkit/pdfselection/attributedstring.md)
- [bounds(for:)](pdfkit/pdfselection/bounds(for:).md)
- [selectionsByLine()](pdfkit/pdfselection/selectionsbyline().md)
