Class ColorRoleResolver
- Namespace
- SharpConsoleUI.Helpers
- Assembly
- SharpConsoleUI.dll
Derives a coordinated ColorRoleSet set from a single ColorRole,
using per-theme seed colours (theme.PrimaryColor and friends) with a fall back to
built-in defaults, plus the two non-null theme anchors. Pure and reflection-free — the single
derivation brain shared by controls and the palette theme generator.
public static class ColorRoleResolver
- Inheritance
-
ColorRoleResolver
- Inherited Members
Methods
Resolve(ColorRole, IContainer?, bool, ColorRoleState, ThemeMode?)
Resolves the coordinated colour set for role using the active theme of
the supplied container (falling back to built-in defaults when the
container or its window system is null).
public static ColorRoleSet Resolve(ColorRole role, IContainer? container, bool outline = false, ColorRoleState state = ColorRoleState.Normal, ThemeMode? mode = null)
Parameters
roleColorRoleThe semantic role to resolve.
containerIContainerThe container whose window-system theme supplies the anchors, or null.
outlineboolWhen true, the role colour is used as text/border on the surface instead of as a fill.
stateColorRoleStateThe interaction state (Normal, Focused, Disabled).
modeThemeMode?When non-null, overrides the theme's ThemeMode for the dark/light seed-colour decision. When null, the theme's own mode is used.
Returns
- ColorRoleSet
A coordinated, contrast-checked ColorRoleSet.
Resolve(ColorRole, ITheme, bool, ColorRoleState, ThemeMode?)
Resolves the coordinated colour set for role against the supplied
theme's two non-null anchors.
public static ColorRoleSet Resolve(ColorRole role, ITheme theme, bool outline = false, ColorRoleState state = ColorRoleState.Normal, ThemeMode? mode = null)
Parameters
roleColorRoleThe semantic role to resolve.
themeIThemeThe theme supplying the surface anchors and mode.
outlineboolWhen true, the role colour is used as text/border on the surface instead of as a fill.
stateColorRoleStateThe interaction state (Normal, Focused, Disabled).
modeThemeMode?When non-null, overrides
theme's ThemeMode for the dark/light seed-colour decision. When null, the theme's own mode is used.
Returns
- ColorRoleSet
A coordinated, contrast-checked ColorRoleSet.