<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKInkingToolReference",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PKInkingTool"
  },
  "title" : "PKInkingToolReference"
}
-->

# PKInkingToolReference

An object that defines the drawing characteristics (width, color, pen style) to use when drawing lines on a canvas view.

```
class PKInkingToolReference
```

## Overview

A [`PKInkingTool`](/documentation/PencilKit/PKInkingTool-swift.struct) object supports the creation of new content on a [`PKCanvasView`](/documentation/PencilKit/PKCanvasView). With an inking tool, the canvas turns touch input from the user into a continuously rendered stroke. The value in the [`width`](/documentation/PencilKit/PKInkingToolReference/width) property determines the base width of that stroke; however, that base value also depends on input from Apple Pencil, including force, azimuth, and angle data.

Create an inking tool programmatically, or display a [`PKToolPicker`](/documentation/PencilKit/PKToolPicker) object and from which a user can select a tool. Assign the resulting object to the [`tool`](/documentation/PencilKit/PKCanvasView/tool-6str6) property of your [`PKCanvasView`](/documentation/PencilKit/PKCanvasView) object. The canvas uses any subsequent touch sequences to draw new content on the canvas. Assigning a new inking tool doesn’t change the characteristics for any previously drawn strokes.

## Topics

### Creating an inking tool

[`init(inkType: __PKInkType, color: UIColor, width: CGFloat)`](/documentation/PencilKit/PKInkingToolReference/init(inkType:color:width:))

Creates an ink tool object with the specified color and line width values.

[`convenience init(inkType: __PKInkType, color: UIColor)`](/documentation/PencilKit/PKInkingToolReference/init(inkType:color:))

Creates an ink tool object with the default line width and the specified color.

[`convenience init(ink: PKInk, width: CGFloat)`](/documentation/PencilKit/PKInkingToolReference/init(ink:width:))

Create an inking tool with the specified ink and width.

### Getting the inking tool attributes

[`var color: UIColor`](/documentation/PencilKit/PKInkingToolReference/color)

The color of the ink.

[`var width: CGFloat`](/documentation/PencilKit/PKInkingToolReference/width)

The base line width for new content.

[`var ink: PKInk`](/documentation/PencilKit/PKInkingToolReference/ink)

The ink that this tool creates strokes with.

### Getting the tool type

[`var inkType: __PKInkType`](/documentation/PencilKit/PKInkingToolReference/inkType)

The tool type that determines the shape of the rendered content.

[`typedef NSString * PKInkType;`](/documentation/PencilKit/PKInkType)

The type that defines the shape of stroked lines.

[`extern PKInkType const PKInkTypeMarker;`](/documentation/PencilKit/PKInkTypeMarker)

An inking tool that creates the appearance of a felt-tip marker.

[`extern PKInkType const PKInkTypePen;`](/documentation/PencilKit/PKInkTypePen)

An inking tool that creates the appearance of drawing with a pen.

[`extern PKInkType const PKInkTypePencil;`](/documentation/PencilKit/PKInkTypePencil)

An inking tool that creates the appearance of drawing with a pencil.

[`extern PKInkType const PKInkTypeMonoline;`](/documentation/PencilKit/PKInkTypeMonoline)

An inking tool that creates the appearance of a monoline pen.

[`extern PKInkType const PKInkTypeFountainPen;`](/documentation/PencilKit/PKInkTypeFountainPen)

An inking tool that creates the appearance of a calligraphy pen.

[`extern PKInkType const PKInkTypeWatercolor;`](/documentation/PencilKit/PKInkTypeWatercolor)

An inking tool that creates the appearance of a watercolor brush.

[`extern PKInkType const PKInkTypeCrayon;`](/documentation/PencilKit/PKInkTypeCrayon)

An inking tool that creates the appearance of a crayon.

### Working with colors

[`class func convert(UIColor, from: UIUserInterfaceStyle, to: UIUserInterfaceStyle) -> UIColor`](/documentation/PencilKit/PKInkingToolReference/convert(_:from:to:))

Converts a color from one user interface style to another.

### Getting the standard ink widths

[`class func defaultWidth(forInkType: __PKInkType) -> CGFloat`](/documentation/PencilKit/PKInkingToolReference/defaultWidth(forInkType:))

Returns the default line width for the specified tool type.

[`class func minimumWidth(forInkType: __PKInkType) -> CGFloat`](/documentation/PencilKit/PKInkingToolReference/minimumWidth(forInkType:))

Returns the minimum allowed line width for the specified tool type.

[`class func maximumWidth(forInkType: __PKInkType) -> CGFloat`](/documentation/PencilKit/PKInkingToolReference/maximumWidth(forInkType:))

Returns the maximum allowed line width for the specified tool type.

### Supporting backward compatibility

[`var requiredContentVersion: PKContentVersion`](/documentation/PencilKit/PKInkingToolReference/requiredContentVersion)

The version of PencilKit necessary to use the inking tool.

### Initializers

[`init(inkType: __PKInkType, color: UIColor, width: CGFloat, azimuth: CGFloat)`](/documentation/PencilKit/PKInkingToolReference/init(inkType:color:width:azimuth:))

### Instance Properties

[`var azimuth: CGFloat`](/documentation/PencilKit/PKInkingToolReference/azimuth)

The base angle of the ink.

### Type Methods

[`class func invertColor(CGColor) -> Unmanaged<CGColor>`](/documentation/PencilKit/PKInkingToolReference/invertColor(_:))

Converts a color from light to dark appearance or vice versa.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

---

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)