Class
RichTextBuilder
ConsoleMonster.Text
Builds RichText fluently: new RichTextBuilder().Append("SPF ", ConsoleColor.Gray).Append("PASS", ThemeToken.Pass, TextDecoration.Bold).Build().
Inheritance
- object
- RichTextBuilder
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 5
- Method RichTextBuilder.Append
- Method RichTextBuilder.AppendLine
- Method RichTextBuilder.AppendLink
- Method RichTextBuilder.AppendMarkup
- Method Ui.RichText
Constructors
public RichTextBuilder() #Methods
Append 3 overloads
public RichTextBuilder Append(string? text, RichStyle style = default) #Appends literal text.
Parameters
- text string?
- The text (shown as written).
- style ConsoleMonster.Styling.RichStyle = default
- The style.
public RichTextBuilder Append(string? text, RichColor color, TextDecoration decoration = None, RichColor backgroundColor = default) #Appends literal text with a color colour, decorations and an optional backgroundColor.
Parameters
- text string?
- The text.
- color ConsoleMonster.Styling.RichColor
- The color (a ConsoleColor, theme role or colour converts implicitly).
- decoration ConsoleMonster.Styling.TextDecoration = None
- Decorations.
- backgroundColor ConsoleMonster.Styling.RichColor = default
- The backgroundColor.
public RichTextBuilder Append(RichText? text) #Appends other rich text.
Parameters
- text ConsoleMonster.Text.RichText?
- The text.
public RichTextBuilder AppendLine() #Appends a line break.
public RichTextBuilder AppendLink(string? text, string url, RichStyle style = default) #Appends a hyperlink (OSC 8 where the terminal supports it, otherwise the text).
Parameters
- text string?
- The text.
- url string
- The target.
- style ConsoleMonster.Styling.RichStyle = default
- The style.
public RichTextBuilder AppendMarkup(string? markup) #Appends markup.
Parameters
- markup string?
- The markup.