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
ProgressBarColor
Gets the progress bar's colour, or null.
public VhColor? ProgressBarColor { get; init; }
Property Value
WindowBackgroundColor
Gets the window's background colour, or null.
public VhColor? WindowBackgroundColor { get; init; }
Property Value
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
assetsIAssetProviderThe UI's content store, or null.
themestringThe theme's name.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<ThemeColors>
A task whose result is the colours.
Exceptions
- OperationCanceledException
cancellationTokenwas canceled: the task is canceled, the one way it ends without colours.