Cherwell Theme System
Cortex renders Cherwell forms using the theme definitions from your Cherwell database. Starting with Cortex 3.2, support for the newer G2 Universal (also called "G2") theme system is included alongside the legacy theme system.
Theme Systems
Legacy Themes
Older Cherwell deployments use a legacy theme system where colors and fonts are defined in ThemeItemList entries. Colors are specified using [RGB], [Web], or similar prefixes.
G2 Universal Themes
Newer Cherwell versions use the G2 Universal theme system, which has a different structure:
- Colors are defined as named palette entries in
PaletteColorList(e.g.<PaletteColor Name="Light">[RGB]239;242;249</PaletteColor>) - ThemeItem values reference palette colors via
[PaletteColor]Lightinstead of inline values - Fonts are defined in
FontStyleList(with size, style, and alignment) rather thanThemeItemList
Resolution Chain
G2 themes resolve colors through a chain of lookups:
[Theme]RectangleBackgroundColor→ looks upThemeItem→ finds[PaletteColor]Light[PaletteColor]Light→ looks upPaletteColorList→ finds[RGB]239;242;249[RGB]239;242;249→ converts to#EFF2F9→ valid CSS color
Cortex automatically detects which theme system a form uses and applies the correct resolution chain.
Theme Definition Browser
Cortex includes a Theme Definitions tab in the Cherwell Database Inspector that lets you explore and debug theme information:
- Browse all ThemeDefs — view all theme definitions stored in the Cherwell database
- View raw XML — inspect the underlying XML for both legacy and G2 Universal themes
- ThemeItemList table — view theme items with color preview swatches
- ThemeCustomColorAssociation — view ID-to-palette color mappings
- PaletteColorList and CustomPaletteColorList — browse palette color definitions
For more information on the Database Inspector, see Troubleshooting.
Style Debugger
The Style Debugger (accessible from the Control Details dialog in the Database Inspector) helps you understand why a specific form element renders the way it does:
- Color preview — see the resolved background, foreground, and border colors for any form control
- Resolution chain trace — view the full lookup chain for each color property, showing exactly where each value comes from
- Gradient background support — view Color1, Color2, and Color3 gradient stops where applicable
- Theme diagnostics panel — see loaded theme information, list counts, and sample data
- Resolution logging — step-by-step logging showing where color lookups succeed or fail
Theme Reference Debugger
The Theme Reference Debugger (also in the Database Inspector) allows you to test theme reference resolution interactively:
- Enter any
[Theme]...or[PaletteColor]...reference - The debugger shows the full resolution chain
- Results are displayed with the final color value and the intermediate steps
This is useful for diagnosing why a particular form element is not rendering with the expected colors.