Skip to content

ToggleSwitchTheme

Namespace: Hex1b.Theming

Assembly: Hex1b.dll

Theme elements for ToggleSwitch widgets.

csharp
public static class ToggleSwitchTheme

Inheritance

ObjectToggleSwitchTheme

Fields

FocusedSelectedBackgroundColor

Background color for the selected option when the toggle has focus.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> FocusedSelectedBackgroundColor

FocusedSelectedForegroundColor

Foreground color for the selected option when the toggle has focus.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> FocusedSelectedForegroundColor

UnfocusedSelectedBackgroundColor

Background color for the selected option when the toggle does not have focus.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> UnfocusedSelectedBackgroundColor

UnfocusedSelectedForegroundColor

Foreground color for the selected option when the toggle does not have focus.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> UnfocusedSelectedForegroundColor

UnselectedBackgroundColor

Background colour for unselected option chips. Defaults to rgb(40, 40, 40), which paints the unselected segments as a recessed dark chip body — the same tone as TextBoxTheme.FillBackgroundColor so the toggle reads as part of the same family of input surfaces. Set to to disable the chip background entirely and let unselected segments inherit the surrounding background.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> UnselectedBackgroundColor

UnselectedForegroundColor

Foreground colour for unselected option chips. Defaults to so unselected labels inherit the surrounding theme's text colour.

Returns: Hex1bThemeElement<Hex1bColor>

csharp
public static readonly Hex1bThemeElement<Hex1bColor> UnselectedForegroundColor

Remarks

The toggle switch renders as a horizontal strip of per-option chips. Each option occupies 1 + label_length + 1 cells (a single padding cell on each side of the label) and is painted in either the unselected colours or — when it is the active option — the selected colours. There is no separator glyph and no outer "field" background; adjacent option chips simply tile against each other.

The selected option has two colour pairs: focused (used when the toggle itself has focus) and unfocused (used when the toggle is inactive). Keeping both lets the selected segment pop more brightly when the toggle is the active focus target without needing an outer field tint to advertise focus.

Released under the MIT License.