Using PencilKit in dark mode results in wrong color

Viewed 627

When in dark mode, it seems that all the color set in PKInkingTool are reversed in brightness. If I choose a bright red I got a dark red, and vice versa.

For example, if I use UIColorPickerViewController to select a color:

PKInkingTool(.pencil, color:color, width:10)

The color that shows up in PKCanvasView is not the correct color. The only way that seems to work is not to support dark mode.

 overrideUserInterfaceStyle = .light

Is there a way to get PencilKit to use the correct color rather than convert color automatically?

1 Answers

You can use 'colorUserInterfaceStyle' for 'PKToolPicker' but in that case if you want to save the drawn part you might have to concern.

colorUserInterfaceStyle = .light
Related