Struct CliCharStyle
- Namespace
- ItTiger.TigerCli.Primitives
- Assembly
- ItTiger.TigerCli.dll
Character-level style for foreground/background colours, text decorations, and hyperlink target.
public struct CliCharStyle
- Inherited Members
Constructors
CliCharStyle(CliColor?, CliColor?, CliTextDecoration)
Character-level style for foreground/background colours, text decorations, and hyperlink target.
public CliCharStyle(CliColor? foreground, CliColor? background = null, CliTextDecoration decorations = CliTextDecoration.None)
Parameters
foregroundCliColor?backgroundCliColor?decorationsCliTextDecoration
Properties
Background
Optional background colour.
public CliColor? Background { readonly get; set; }
Property Value
Decorations
Text decoration flags (bold/italic/underline). Additive during markup cascading: nested
scopes OR their flags onto the effective style. Defaults to None.
public CliTextDecoration Decorations { readonly get; set; }
Property Value
Foreground
Optional foreground colour.
public CliColor? Foreground { readonly get; set; }
Property Value
HyperlinkTarget
Resolved hyperlink target (URI) for this text run, or
null when the run is not a link.
When set, an ANSI sink may wrap the visible text in an OSC 8 hyperlink (see
AnsiSink); all other sinks ignore it and render the
visible text only, so link text always stays visible and copyable. The target is resolved once
(from the markup span's visible text, or a hyperlink cell's full visible value) and carried on
the style so it survives wrapping, splitting, truncation, and segment reassembly. Backgrounds
and colours are unaffected.public string? HyperlinkTarget { readonly get; set; }
Property Value
Methods
Clone(CliCharStyle?)
Creates a copy of a character style, or
null when style is null.public static CliCharStyle? Clone(CliCharStyle? style)
Parameters
styleCliCharStyle?
Returns
HasSameRenderingAs(CliCharStyle)
Returns
true when other has the same render-relevant identity as this
style: identical foreground, background, decorations, and hyperlink target. This is the single
source of truth for deciding whether two adjacent CliTextSegments may be merged /
coalesced — two segments may only be merged when this returns true, otherwise a style
difference (e.g. bold, underline, or a link target) would be silently dropped. Every field that
affects rendering must be compared here; add any new render-relevant field to this method.public readonly bool HasSameRenderingAs(CliCharStyle other)
Parameters
otherCliCharStyle