Skip to main content

Color Configuration

In order to fit the Docutain Scanner SDK for Capacitor into your corporate design, you have a bunch of options to alter the default color theming of the ready to use UI components.

Supported colors

The following is a list of all colors currently supported.

ColorDefault ValueDescription
ColorPrimarylight: #4CAF50
dark: #4CAF50
Used to tint progress indicators, the text color of secondary or dialog buttons and the background color of primary buttons. theming_dialog_button theming_progress_indicators theming_buttons
ColorOnPrimarylight: #FFFFFF
dark: #000000
Used to tint elements that reside on ColorPrimary, like the icon and text of primary buttons. E.g. on the empty result screen or onboarding. theming_buttons
ColorSecondarylight: #4CAF50
dark: #4CAF50
Used to tint selectable controls and the capture button. theming_selection_controls
theming_capture_button
ColorOnSecondarylight: #FFFFFF
dark: #000000
Used to tint elements that reside on ColorSecondary, like the icon of the capture button.
theming_capture_button
ColorScanButtonsLayoutBackgroundlight: #121212
dark: #121212
Used to tint the background of the scan buttons layout.
theming_scan_buttons_layout
ColorScanButtonsForegroundlight: #FFFFFF
dark: #FFFFFF
Used to tint the foreground of the scan buttons layout, like the torch button.
theming_scan_buttons_layout
ColorScanPolygonlight: #4CAF50
dark: #4CAF50
Used to tint the polygon overlay which highlights the currently detected document.
theming_scan_polygon
ColorBottomBarBackgroundlight: #FFFFFF
dark: #212121
Used to tint the bottom toolbar background of the image editing page.
theming_edit_bottombar
ColorBottomBarForegroundlight: #323232
dark: #BEBEBE
Used to tint the buttons within the bottom toolbar of the image editing page.
theming_edit_bottombar
ColorTopBarBackgroundlight: #4CAF50
dark: #2a2a2a
Used to tint the top toolbar background. theming_topbar
ColorTopBarForegroundlight: #FFFFFF
dark: #DEFFFFFF
Used to tint the buttons contained in the top toolbar. theming_topbar
ColorTopBarTitlelight: #FFFFFF
dark: #DEFFFFFF
Used to tint the text of the top toolbar title. theming_topbar_title

Dark Mode

The Docutain Scanner SDK for Capacitor also supports dark mode theming. The process is the same, just define different colors for the night version of your theme. The SDK decides which color to use depending on the device's sytem setting and it will change at runtime, if the device's display mode changes.

theming_edit_bottombar theming_edit_bottombar_dark

Defining a custom theme

In order to alter at least one of the colors mentioned above, you need to pass a ColorConfig containing the colors you wish to alter.

The following is an example which alters some (not all) colors to get a bluish-purple theme.

import { DocutainSDK } from '@docutain/capacitor-plugin-docutain-sdk'

const result = await DocutainSDK.startDocumentScanner({
ColorConfig: {
ColorTopBarBackground: {
Light: '#0000CF',
Dark: '#2A2A2A'
},
ColorBottomBarBackground: {
Light: '#0000CF',
Dark: '#2A2A2A'
},
ColorPrimary: {
Light: '#0000CF',
Dark: '#b894f6'
},
ColorSecondary: {
Light: '#0000CF',
Dark: '#b894f6'
},
ColorOnSecondary: {
Light: '#FFFFFF',
Dark: '#000000'
},
ColorScanPolygon: {
Light: '#0000CF',
Dark: '#b894f6'
},
ColorBottomBarForeground: {
Light: '#FFFFFF',
Dark: '#DEFFFFFF'
}
}
});