<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKInkingTool-swift.struct/convertColor(_:from:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit12PKInkingToolV12convertColor_4from2toSo7UIColorCAH_So20UIUserInterfaceStyleVAJtFZ"
  },
  "title" : "convertColor(_:from:to:)"
}
-->

# convertColor(_:from:to:)

Convert a color from one user interface style to another.

```
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

A <doc://com.apple.documentation/documentation/UIKit/UIColor> from the user interface style specified in the `to` parameter.

---

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)