---
title: "convertColor(_:from:to:)"
framework: pencilkit
role: symbol
role_heading: Type Method
path: "pencilkit/pkinkingtool-swift.struct/convertcolor(_:from:to:)"
---

# convertColor(_:from:to:)

Convert a color from one user interface style to another.

## Declaration

```swift
static func convertColor(_ color: UIColor, from: UIUserInterfaceStyle, to: UIUserInterfaceStyle) -> UIColor
```

## Parameters

- `color`: The color to convert.
- `from`: The user interface style to convert the color from.
- `to`: The user interface style to convert the color to.

## Return Value

Return Value A UIColor from the user interface style specified in the to parameter.
