Table of Contents

Class TigerColorAliasRegistry

Namespace
ItTiger.TigerCli.Tui.Themes
Assembly
ItTiger.TigerCli.dll
App-scoped registry of raw colour aliases: application-defined names for concrete CliColor values (e.g. BrandOrangeOrange). Aliases are valid only in raw colour positions of markup ([BrandOrange], [White on CompanyBlue]) and are a different concept from semantic styles.

TigerCli ships no built-in aliases — only the CliColor enum names are known by default. Apps (or opt-in libraries) register the aliases they want. A registered alias takes precedence over a CliColor enum name of the same name: registering an alias is a deliberate app policy, so the alias wins and the enum value remains the fallback when no alias is registered.

Instances are app-local: construct one per app/test, configure it, then make it active via TigerConsole.ColorAliases. Nothing is process-global.
public sealed class TigerColorAliasRegistry : IColorAliasResolver
Inheritance
TigerColorAliasRegistry
Implements
Inherited Members

Properties

IsEmpty

True when no aliases are registered.
public bool IsEmpty { get; }

Property Value

bool

Names

The registered alias names (case-insensitive), in no particular order. Snapshot.
public IReadOnlyCollection<string> Names { get; }

Property Value

IReadOnlyCollection<string>

Methods

Contains(string)

True when an alias with this name is registered (case-insensitive).
public bool Contains(string alias)

Parameters

alias string

Returns

bool

Register(string, CliColor)

Registers (or overwrites) a colour alias. Alias names are case-insensitive and must be a single markup token: letters and digits only, no whitespace, and not one of the reserved raw-expression keywords (on, bold, italic, underline) which the parser interprets specially and could never reach an alias.
public TigerColorAliasRegistry Register(string alias, CliColor color)

Parameters

alias string
color CliColor

Returns

TigerColorAliasRegistry

Exceptions

ArgumentException
The name is null/empty/whitespace, contains non-alphanumeric characters, or is reserved.

Remove(string)

Removes an alias if present. Returns true when an alias was removed.
public bool Remove(string alias)

Parameters

alias string

Returns

bool

TryResolve(string, out CliColor)

Tries to resolve name (case-insensitive) to a registered colour alias. Returns false for unregistered names so the parser can fall back to CliColor enum names. Registered aliases take precedence over enum names (see TigerColorAliasRegistry).
public bool TryResolve(string name, out CliColor color)

Parameters

name string
color CliColor

Returns

bool