---
title: "convert(_:from:to:)"
framework: pencilkit
role: symbol
role_heading: Type Method
path: "pencilkit/pkinkingtoolreference/convert(_:from:to:)"
---

# convert(_:from:to:)

Converts a color from one user interface style to another.

## Declaration

```swift
class func convert(_ color: UIColor, from fromUserInterfaceStyle: UIUserInterfaceStyle, to toUserInterfaceStyle: UIUserInterfaceStyle) -> UIColor
```

## Parameters

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