CPDFView has four special color modes: dark mode, sepia mode, reseda mode, and custom color mode.


In dark mode, colors are adjusted to improve reading at night or in a poorly-lit environment, in sepia mode, background color is set to emulate the look of an old book, in reseda mode, light-green background is displayed to protect your eyes after long-time reading, and in custom color mode, you can set a custom color for the background color.


NoteChanging the appearance mode will change the PDF rendering style, but it does not modify the PDF on disk.


To set the color mode:

1. Find the constant value of the color mode   

Themes Constant value
Normal color mode CPDFDisplayModeNormal
Dark mode CPDFDisplayModeNight
Sepia mode CPDFDisplayModeSoft
Reseda mode CPDFDisplayModeGreen
Custom color mode CPDFDisplayModeCustom


2. Call CPDFView::setDisplayMode:.


3. If you are using CPDFDisplayModeCustom, call CPDFView::setDisplayModeCustomColor: to set the background color.


4. Update CPDFView to redraw the contents.


[pdfView layoutDocumentView];


You also can configure the color mode of CPDFView in CPDFKitConfig.


CPDFKitShareConfig.displayMode = CPDFDisplayModeCustom;
CPDFKitShareConfig.displayModeCustomColor = [UIColor whiteColor];