<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKInkingTool-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit12PKInkingToolV"
  },
  "title" : "PKInkingTool"
}
-->

# PKInkingTool

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

```
struct PKInkingTool
```

## 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/PKInkingTool-swift.struct/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(_:color:width:)`](/documentation/PencilKit/PKInkingTool-swift.struct/init(_:color:width:)-2l7v)

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

[`init(_:color:width:)`](/documentation/PencilKit/PKInkingTool-swift.struct/init(_:color:width:)-4i3ft)

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

[`init(ink:width:)`](/documentation/PencilKit/PKInkingTool-swift.struct/init(ink:width:))

Create an inking tool with the specified ink and width.

### Getting the width information

[`defaultWidth`](/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum/defaultWidth)

The default line width for the specified tool type.

[`validWidthRange`](/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum/validWidthRange)

The range of widths allowed for an ink of this type.

### Getting the inking tool attributes

[`color`](/documentation/PencilKit/PKInkingTool-swift.struct/color-5xmlo)

The color of the ink.

[`color`](/documentation/PencilKit/PKInkingTool-swift.struct/color-22zaw)

The color of the ink.

[`width`](/documentation/PencilKit/PKInkingTool-swift.struct/width)

The width of the ink.

[`ink`](/documentation/PencilKit/PKInkingTool-swift.struct/ink)

The ink used by this inking tool.

### Getting the tool type

[`inkType`](/documentation/PencilKit/PKInkingTool-swift.struct/inkType-swift.property)

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

[`PKInkingTool.InkType`](/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum)

The type that defines the shape of stroked lines.

### Comparing inking tool types

### Working with colors

[`convertColor(_:from:to:)`](/documentation/PencilKit/PKInkingTool-swift.struct/convertColor(_:from:to:))

Convert a color from one user interface style to another.

### Supporting backward compatibility

[`requiredContentVersion`](/documentation/PencilKit/PKInkingTool-swift.struct/requiredContentVersion)

The version of PencilKit necessary to use the inking tool.

### Using reference types

[`PKInkingToolReference`](/documentation/PencilKit/PKInkingToolReference)

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



---

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)