Table of Contents

Class ButtonColorSet

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Immutable record representing a color set for a button control.

public record ButtonColorSet : IEquatable<ButtonColorSet>
Inheritance
ButtonColorSet
Implements
Inherited Members

Properties

BackgroundColor

Gets the background color for the button.

public Color BackgroundColor { get; init; }

Property Value

Color

ForegroundColor

Gets the foreground (text) color for the button.

public Color ForegroundColor { get; init; }

Property Value

Color

IsEnabled

Gets a value indicating whether the button is enabled.

public bool IsEnabled { get; init; }

Property Value

bool

IsFocused

Gets a value indicating whether the button is focused.

public bool IsFocused { get; init; }

Property Value

bool

Methods

FromTheme(ITheme, bool, bool)

Creates a ButtonColorSet from a theme based on button state.

public static ButtonColorSet FromTheme(ITheme theme, bool isFocused, bool isEnabled)

Parameters

theme ITheme

The theme to derive colors from.

isFocused bool

Whether the button is currently focused.

isEnabled bool

Whether the button is enabled.

Returns

ButtonColorSet

A new ButtonColorSet with the appropriate colors.