Skip to content
ConsoleMonster
Class

Logo

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

Banner text drawn with a built-in 5x7 pixel font on a half-block canvas (two pixel rows per cell, four cell rows tall) with a horizontal colour gradient, and an optional tagline. On the Ascii tier the same font is drawn with #; when the banner does not fit, it falls back to bold text.

Inheritance

  • object
  • Logo

Usage

Explore 23 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 11

Accepted by parameters 12

Constructors

public Logo(string text, string? tagline = null) #

Creates a logo.

Parameters

text string required
The banner text (A-Z, 0-9 and - . : ! / _).
tagline string? = null optional
An optional tagline under the banner (markup).

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public string Text { get; set; } #

The banner text.

public string? Tagline { get; set; } #

The tagline (markup).

public Color StartColor { get; set; } #

The gradient start colour (default sky blue).

public Color EndColor { get; set; } #

The gradient end colour (default violet).

public HorizontalAlignment Alignment { get; set; } #

Alignment of the banner and tagline (default left).

Extension Methods

public static Logo Alignment(Logo logo, HorizontalAlignment value) #

Sets Logo.Alignment: Alignment of the banner and tagline (default left).

Parameters

logo ConsoleMonster.Widgets.Logo required
The instance.
value ConsoleMonster.Layout.HorizontalAlignment required
The value.

Returns

Logo The same instance.

Examples

// C# initializer or property    // C# fluent
logo.Alignment = value;          Ui.Logo().Alignment(value);
public static Logo EndColor(Logo logo, Color value) #

Sets Logo.EndColor: The gradient end colour (default violet).

Parameters

logo ConsoleMonster.Widgets.Logo required
The instance.
value ConsoleMonster.Styling.Color required
The value.

Returns

Logo The same instance.

Examples

// C# initializer or property    // C# fluent
logo.EndColor = value;           Ui.Logo().EndColor(value);
public static Logo StartColor(Logo logo, Color value) #

Sets Logo.StartColor: The gradient start colour (default sky blue).

Parameters

logo ConsoleMonster.Widgets.Logo required
The instance.
value ConsoleMonster.Styling.Color required
The value.

Returns

Logo The same instance.

Examples

// C# initializer or property    // C# fluent
logo.StartColor = value;         Ui.Logo().StartColor(value);
public static Logo Tagline(Logo logo, string? value) #

Sets Logo.Tagline: The tagline (markup).

Parameters

logo ConsoleMonster.Widgets.Logo required
The instance.
value string? required
The value.

Returns

Logo The same instance.

Examples

// C# initializer or property    // C# fluent
logo.Tagline = value;            Ui.Logo().Tagline(value);
public static Logo Text(Logo logo, string value) #

Sets Logo.Text: The banner text.

Parameters

logo ConsoleMonster.Widgets.Logo required
The instance.
value string required
The value.

Returns

Logo The same instance.

Examples

// C# initializer or property    // C# fluent
logo.Text = value;               Ui.Logo().Text(value);