Table of Contents

Struct FormattedChar

Namespace
InteractiveReadLine.Formatting
Assembly
InteractiveReadLine.dll

A struct representing a single character and its foreground and background colors. Null colors represents the system defaults.

public struct FormattedChar : IEquatable<FormattedChar>
Implements
Inherited Members

Constructors

FormattedChar(char, ConsoleColor?, ConsoleColor?)

Creates a character with the specified foreground and background colors. Either color can be null to use the display default.

public FormattedChar(char c, ConsoleColor? foreground, ConsoleColor? background)

Parameters

c char

The character.

foreground ConsoleColor?

The foreground color, or null to use the display default.

background ConsoleColor?

The background color, or null to use the display default.

Properties

Background

Gets the background color, or null when the display default should be used.

public readonly ConsoleColor? Background { get; }

Property Value

ConsoleColor?

Char

Gets the character without its formatting.

public readonly char Char { get; }

Property Value

char

Foreground

Gets the foreground color, or null when the display default should be used.

public readonly ConsoleColor? Foreground { get; }

Property Value

ConsoleColor?

Methods

Equals(FormattedChar)

Determines whether this instance and another formatted character have the same character and colors.

public bool Equals(FormattedChar other)

Parameters

other FormattedChar

Returns

bool

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.