Struct
ThemeColor
ConsoleMonster.Styling
A theme colour with explicit fallbacks per colour tier. Automatic nearest-colour downsampling often turns carefully chosen RGB tones into muddy greys on a 16-colour console, so themes state the 16-colour (and optionally 256-colour) choice deliberately.
Inheritance
- ValueType
- ThemeColor
Usage
Explore 6 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 4
- Method ThemeColor.Hex
- Method ThemeColor.PaletteIndex
- Property ThemeStyle.BackgroundColor
- Property ThemeStyle.Color
Accepted by parameters 2
- Constructor ThemeStyle.ThemeStyle
- Constructor ThemeStyle.ThemeStyle
Constructors
public ThemeColor(Color trueColor, int ansi16, int ansi256 = -1) #Creates a theme colour.
Parameters
- trueColor ConsoleMonster.Styling.Color
- The 24-bit colour.
- ansi16 int
- The 16-colour index (0-15) to use on 16-colour terminals.
- ansi256 int = -1
- The 256-colour index, or -1 to downsample trueColor automatically.
Methods
public static ThemeColor Hex(string hex, int ansi16, int ansi256 = -1) #Creates a theme colour from a hex string and a 16-colour index.
Parameters
- hex string
- The 24-bit colour as #rrggbb.
- ansi16 int
- The 16-colour index.
- ansi256 int = -1
- The 256-colour index or -1.
public static ThemeColor PaletteIndex(int index) #Creates a terminal palette reference (0-15) that remains an index at true colour depth.
Parameters
- index int
Returns
ThemeColorpublic Color Resolve(ColorDepth depth) #Returns the concrete colour for a colour depth.
Parameters
- depth ConsoleMonster.Capabilities.ColorDepth
- The depth.
Inherited Methods
Properties
public bool IsPaletteIndex { get; } #True when this colour keeps its terminal palette index at every colour depth.