To create a custom color scheme, subclass npyscreen.ThemeManager and define a default_colors dictionary. This dictionary maps semantic color names (used by widgets) to specific color-pair strings defined in the theme.
Common semantic keys include:
DEFAULT: General widget colorFORMDEFAULT: Form widget colorLABEL: Color for widget labelsLABELBOLD: Color for bold labelsCONTROL: Color for control elementsIMPORTANT, SAFE, GOOD: Success/Positive colorsWARNING, CAUTION: Warning colorsDANGER, CRITICAL: Error/Danger colorsCURSOR: Color for the cursor
Example of a custom theme definition:
class MyCustomTheme(npyscreen.ThemeManager):
default_colors = {
'DEFAULT' : 'WHITE_BLACK',
'LABEL' : 'GREEN_BLACK',
'DANGER' : 'RED_BLACK',
'IMPORTANT' : 'GREEN_BLACK',
}
class DefaultTheme(npyscreen.ThemeManager):
default_colors = {
'DEFAULT' : 'WHITE_BLACK',
'FORMDEFAULT' : 'WHITE_BLACK',
'NO_EDIT' : 'BLUE_BLACK',
'STANDOUT' : 'CYAN_BLACK',
'CURSOR' : 'WHITE_BLACK',
'CURSOR_INVERSE': 'BLACK_WHITE',
'LABEL' : 'GREEN_BLACK',
'LABELBOLD' : 'WHITE_BLACK',
'CONTROL' : 'YELLOW_BLACK',
'IMPORTANT' : 'GREEN_BLACK',
'SAFE' : 'GREEN_BLACK',
'WARNING' : 'YELLOW_BLACK',
'DANGER' : 'RED_BLACK',
'CRITICAL' : 'BLACK_RED',
'GOOD' : 'GREEN_BLACK',
'GOODHL' : 'GREEN_BLACK',
'VERYGOOD' : 'BLACK_GREEN',
'CAUTION' : 'YELLOW_BLACK',
'CAUTIONHL' : 'BLACK_YELLOW',
}