Class ColorRoles
The source of this table is the vocabulary of THEME-DESIGN.md section 4.3, exactly, frozen 2026-09-25 (ruling R9): 37 color roles organised by element and state. The shipped theme sheet (iz/css/iiziThemes.css) defines every one of these properties in every theme, and a completeness test there enforces it; here the table is the Java side of the same contract - the names the Designer shows, the names a GColor reference may use bare (%Accent), and the names the platform base palette holds. Neither side invents or renames a role: renaming one touches every converted CSS file and every palette (ruling Q2, 2026-09-12).
ACCENT is the first entry because the nine names this list grew from - the former GColor.THEME_NAMES, never read by anything - started with it. Adding a role is additive and cheap; reducing the set is not allowed (ruling Q3).
Each role belongs to one of the seven groups of the vocabulary table, which is the order the Designer's theme editor shows them in; and the CONTRAST_PAIRS name the foreground and background roles whose contrast a theme is checked for (WCAG 2.x, ColorContrast).
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA pair of roles whose contrast a theme is checked for: a foreground drawn on a background, and the WCAG 2.x ratio it needs.static enumThe groups of the vocabulary table (THEME-DESIGN.mdsection 4.3), in the order the theme editor shows them.static final recordA color role: its name as the Designer shows it, the CSS custom property it becomes, and the group of the vocabulary table it belongs to.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe accent color, the first role.static final StringThe accent color when hovered.static final StringThe accent color when pressed.static final StringThe text on the accent color.static final StringThe border.static final List<ColorRoles.ContrastPair> The pairs a theme's contrast is checked for, per mode (THEME-DESIGN.mdsection 4.3, order CC-THEME-TE1-MODEL): every text role on the backgrounds it is drawn on atColorContrast.AA_TEXT, and the marks a user must see - border, focus outline, accent, widget base - atColorContrast.AA_NON_TEXT.static final StringThe disabled background.static final StringThe disabled text.static final StringThe divider.static final StringThe error background.static final StringThe error text.static final StringThe focus outline.static final StringThe header background.static final StringThe header text.static final StringThe hovered background.static final StringThe hovered text.static final StringThe info background.static final StringThe info text.static final StringThe link text.static final StringThe visited link text.static final StringThe muted, secondary text.The role names in the order ofROLES, immutable.static final StringThe normal background.static final StringThe normal text.static final StringThe pressed background: touch has no hover.static final StringThe pressed text.static final StringThe raised background: dialogs, prompts, menus, cards.static final List<ColorRoles.Role> The 37 roles in the order of the vocabulary table,ACCENTfirst.static final StringThe scrim: modal cover, Float scrim.static final StringThe selected background.static final StringThe selected text.static final StringThe success background.static final StringThe success text.static final StringThe sunken background: inputs, wells.static final StringThe tooltip background.static final StringThe tooltip text.static final StringThe warning background.static final StringThe warning text.static final StringThe widget background.static final StringThe widget base color.Method Summary
Modifier and TypeMethodDescriptionstatic ColorRoles.RoleGets a role by name.static booleanChecks if a name is a color role.
Field Details
ACCENT
NORMAL_BACKGROUND
RAISED_BACKGROUND
The raised background: dialogs, prompts, menus, cards.- See Also:
SUNKEN_BACKGROUND
HEADER_BACKGROUND
HEADER_TEXT
TOOLTIP_BACKGROUND
TOOLTIP_TEXT
SCRIM_BACKGROUND
NORMAL_TEXT
MUTED_TEXT
LINK_TEXT
LINK_VISITED_TEXT
ACCENT_TEXT
ACCENT_HOVERED
ACCENT_PRESSED
WIDGET_BASE
WIDGET_BACKGROUND
HOVERED_BACKGROUND
HOVERED_TEXT
PRESSED_BACKGROUND
PRESSED_TEXT
SELECTED_BACKGROUND
SELECTED_TEXT
DISABLED_BACKGROUND
DISABLED_TEXT
ERROR_TEXT
ERROR_BACKGROUND
WARNING_TEXT
WARNING_BACKGROUND
SUCCESS_TEXT
SUCCESS_BACKGROUND
INFO_TEXT
INFO_BACKGROUND
BORDER
DIVIDER
FOCUS_OUTLINE
ROLES
The 37 roles in the order of the vocabulary table,ACCENTfirst.NAMES
CONTRAST_PAIRS
The pairs a theme's contrast is checked for, per mode (THEME-DESIGN.mdsection 4.3, order CC-THEME-TE1-MODEL): every text role on the backgrounds it is drawn on atColorContrast.AA_TEXT, and the marks a user must see - border, focus outline, accent, widget base - atColorContrast.AA_NON_TEXT. The disabled text is exempt, as WCAG exempts inactive controls.
Method Details
isRole
Checks if a name is a color role.- Parameters:
name- The name, case sensitive.- Returns:
- true if the name is one of the 37 roles, false otherwise (also for null).
get
Gets a role by name.- Parameters:
name- The role name, case sensitive.- Returns:
- The role, or null if the name is not a role (also for null).