Theming & Styles
ComPDFKit_Tools provides two levels of theme configuration: Global Theme Mode and Reader Theme.
Global Theme Mode (themeMode)
GlobalConfig.themeMode controls the overall appearance of UI components:
{
"global": {
"themeMode": "system"
}
}| Value | Description |
|---|---|
"light" | Light mode |
"dark" | Dark mode |
"system" | Follow system settings |
This configuration affects the color scheme of all UI components including toolbars, dialogs, and property panels.
Reader Theme (themes)
ReaderViewConfig.themes controls the background and rendering theme of the PDF reading area:
{
"readerViewConfig": {
"themes": "light"
}
}| Value | Description |
|---|---|
"light" | White background |
"dark" | Dark background |
"sepia" | Eye-comfort (warm tone) background |
"reseda" | Green eye-comfort background |
Differences Between the Two
| Dimension | global.themeMode | readerViewConfig.themes |
|---|---|---|
| Scope | UI components (toolbars, dialogs, etc.) | PDF document rendering area |
| Values | light, dark, system | light, dark, sepia, reseda |
| Typical Use | Adapt to system dark mode | Provide eye-comfort reading mode |
The two can be configured independently. For example, you can have the UI follow system dark mode while the reading area uses the eye-comfort theme:
{
"global": {
"themeMode": "system"
},
"readerViewConfig": {
"themes": "sepia"
}
}Custom Theme Colors
For further color scheme customization, you can override the color values defined by ComPDFKit_Tools in Android resource files. The Tools module uses the standard Android resource system — simply define color values with the same names in your app's res/values/colors.xml and res/values-night/colors.xml to override them.