API Reference
ConsoleColorMap
Maps rendered cell colours to the 16 ConsoleColor values a console API or a PowerShell host can show (Console.ForegroundColor, Write-Host -ForegroundColor). Theme roles map by meaning (pass green, fail red, warn yellow, muted dark grey, accent cyan; darker variants on the light theme), plain text keeps the host's own colour, and anything else falls back to the nearest of the 16 colours.
Inheritance
- Object
- ConsoleColorMap
Constructors
public ConsoleColorMap(RenderContext context, Boolean enabled = true) #Creates a map for a render context.
Parameters
- context ConsoleMonster.Canvas.RenderContext
- The context the cells were rendered with.
- enabled System.Boolean = true
- False when colour is off (NO_COLOR, CONSOLEMONSTER_COLOR=none, plain mode).
Methods
public ConsoleColor? Background(Color color) #ConsoleColor?The host colour for a cell background, or null for the host's default.
Parameters
- color ConsoleMonster.Styling.Color
- The cell colour.
Returns
The console colour, or null.
public static Boolean ColorDisabled(TerminalProfile profile) #BooleanWhether colour is off for host output: NO_COLOR (unless CONSOLEMONSTER_COLOR names a depth), CONSOLEMONSTER_COLOR=none, or plain mode.
Parameters
- profile ConsoleMonster.Capabilities.TerminalProfile
- The detected profile.
Returns
True when host output must stay uncoloured.
public ConsoleColor? Foreground(Color color) #ConsoleColor?The host colour for a cell foreground, or null for the host's default.
Parameters
- color ConsoleMonster.Styling.Color
- The cell colour.
Returns
The console colour, or null.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?