---
title: "init(_:color:width:)"
framework: pencilkit
role: symbol
role_heading: Initializer
path: "pencilkit/pkinkingtool-swift.struct/init(_:color:width:)-4i3ft"
---

# init(_:color:width:)

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

## Declaration

```swift
init(_ inkType: PKInkingTool.InkType, color: NSColor = NSColor.black, width: CGFloat? = nil)
```

## Parameters

- `inkType`: The shape of the tool, which can be doc://com.apple.pencilkit/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum/marker, doc://com.apple.pencilkit/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum/pen, or doc://com.apple.pencilkit/documentation/PencilKit/PKInkingTool-swift.struct/InkType-swift.enum/pencil.
- `color`: The color to apply to drawn lines.
- `width`: The base width to apply to any drawn lines. The value in the inkType parameter and input from Apple Pencil affects the final width.

## See Also

### Creating an inking tool

- [init(_:color:width:)](pencilkit/pkinkingtool-swift.struct/init(_:color:width:)-2l7v.md)
- [init(ink:width:)](pencilkit/pkinkingtool-swift.struct/init(ink:width:).md)
