Table of Contents

Class ThemeColors

Namespace
VpnHood.AppUi.Common
Assembly
VpnHood.AppUi.Common.dll

Represents the colours the native chrome around the UI draws with, the window's and the bars', as the theme names them in the UI's content store.

public class ThemeColors
Inheritance
ThemeColors
Inherited Members

Remarks

A colour the theme does not name is null, and that part of the chrome keeps the system's.

Properties

NavigationBarColor

Gets the navigation bar's colour, or null.

public VhColor? NavigationBarColor { get; init; }

Property Value

VhColor?

ProgressBarColor

Gets the progress bar's colour, or null.

public VhColor? ProgressBarColor { get; init; }

Property Value

VhColor?

WindowBackgroundColor

Gets the window's background colour, or null.

public VhColor? WindowBackgroundColor { get; init; }

Property Value

VhColor?

Methods

LoadAsync(IAssetProvider?, string, CancellationToken)

Loads a theme's colours, for a start: with no store, it gives the built-in look; with no such theme or a store that cannot be read, it logs the error and gives the built-in look.

public static Task<ThemeColors> LoadAsync(IAssetProvider? assets, string theme, CancellationToken cancellationToken)

Parameters

assets IAssetProvider

The UI's content store, or null.

theme string

The theme's name.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<ThemeColors>

A task whose result is the colours.

Exceptions

OperationCanceledException

cancellationToken was canceled: the task is canceled, the one way it ends without colours.