Table of Contents

Class NotificationBrushes

Namespace
McServerLauncher.ViewModels
Assembly
McServerLauncher.dll

The configured notification colours, as something Avalonia can draw with.

public static class NotificationBrushes
Inheritance
NotificationBrushes
Inherited Members

Remarks

The counterpart of ServerTypeBrushes, and split from NotificationPalette for the same reason that one is split from ServerTypeCatalog: the strings are a setting and belong somewhere that knows nothing about a UI framework, and the conversion belongs somewhere a UI can reach. Not cached, unlike the server-type brushes — these change whenever the user edits them, and a toast is built a handful of times a day.

Methods

BrushFor(NotificationSettings?, NotificationLevel)

The accent for a level: the border of the toast and its mark.

public static IBrush BrushFor(NotificationSettings? settings, NotificationLevel level)

Parameters

settings NotificationSettings
level NotificationLevel

Returns

IBrush

ColorFor(NotificationSettings?, NotificationLevel)

The colour for a level, falling back to the default for anything unparseable.

public static Color ColorFor(NotificationSettings? settings, NotificationLevel level)

Parameters

settings NotificationSettings
level NotificationLevel

Returns

Color

FadedBrushFor(NotificationSettings?, NotificationLevel, byte)

The same colour faded, for a surface the text has to stay readable against.

public static IBrush FadedBrushFor(NotificationSettings? settings, NotificationLevel level, byte alpha = 102)

Parameters

settings NotificationSettings
level NotificationLevel
alpha byte

Returns

IBrush

Remarks

Derived from the accent rather than configured on its own. Two colours per level would be eight settings and eight chances to choose a pair nobody can read; one alpha over the colour the user picked cannot produce that.