Class TigerColorAliasRegistry
App-scoped registry of raw colour aliases: application-defined names for concrete
CliColor values (e.g.
BrandOrange → Orange). 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 viaTigerConsole.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
Names
The registered alias names (case-insensitive), in no particular order. Snapshot.
public IReadOnlyCollection<string> Names { get; }
Property Value
Methods
Contains(string)
True when an alias with this name is registered (case-insensitive).
public bool Contains(string alias)
Parameters
aliasstring
Returns
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
Returns
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
aliasstring
Returns
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)