API Reference
Struct
ThemeColor
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 5 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 3
- Method ThemeColor.Hex
- Property ThemeStyle.Background
- Property ThemeStyle.Foreground
Accepted by parameters 2
- Constructor ThemeStyle.ThemeStyle
- Constructor ThemeStyle.ThemeStyle
Constructors
public ThemeColor(Color trueColor, Int32 ansi16, Int32 ansi256 = -1) #Creates a theme colour.
Parameters
- trueColor ConsoleMonster.Styling.Color
- The 24-bit colour.
- ansi16 System.Int32
- The 16-colour index (0-15) to use on 16-colour terminals.
- ansi256 System.Int32 = -1
- The 256-colour index, or -1 to downsample trueColor automatically.
Methods
public static ThemeColor Hex(String hex, Int32 ansi16, Int32 ansi256 = -1) #Returns:
ThemeColorCreates a theme colour from a hex string and a 16-colour index.
Parameters
- hex System.String
- The 24-bit colour as #rrggbb.
- ansi16 System.Int32
- The 16-colour index.
- ansi256 System.Int32 = -1
- The 256-colour index or -1.
Returns
The theme colour.
public Color Resolve(ColorDepth depth) #Returns:
ColorReturns the concrete colour for a colour depth.
Parameters
- depth ConsoleMonster.Capabilities.ColorDepth
- The depth.
Returns
The colour to emit.
Inherited Methods
public override Boolean Equals(Object? obj) #Returns:
BooleanInherited from ValueType
Parameters
- obj Object?