ApplicationAccentColorManager
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf
public static class ApplicationAccentColorManager
Manages system and custom accent colors and publishes them as DynamicResource brush keys aligned with Windows 11.
Remarks: Apply uses the Windows accent palette by default. Call ApplyCustomAccent to pin a custom accent, or ApplySystemAccent to return to the Windows palette.
Example
ApplicationThemeManager.Apply(ApplicationTheme.Auto, WindowBackdropType.Mica);
ApplicationAccentColorManager.ApplyCustomAccent(System.Windows.Media.Colors.CornflowerBlue);
Properties
IsAccentColorOnTitleBarsEnabled
public static bool IsAccentColorOnTitleBarsEnabled { get; }
Gets a value indicating whether Windows is configured to show accent color on title bars and window borders.
SystemAccentColor
public static Color SystemAccentColor { get; }
Gets the current base accent color (ARGB). A theme apply loads the Windows accent palette by default; before the first apply, this returns the fallback blue.
SystemAccentColorDark1
public static Color SystemAccentColorDark1 { get; }
Gets the first dark shade on the generated accent ramp.
SystemAccentColorDark2
public static Color SystemAccentColorDark2 { get; }
Gets the second dark shade on the generated accent ramp.
SystemAccentColorDark3
public static Color SystemAccentColorDark3 { get; }
Gets the darkest shade on the generated accent ramp.
SystemAccentColorLight1
public static Color SystemAccentColorLight1 { get; }
Gets the first light tint on the generated accent ramp. Default matches SystemAccentColor until the ramp is loaded.
SystemAccentColorLight2
public static Color SystemAccentColorLight2 { get; }
Gets the second light tint on the generated accent ramp.
SystemAccentColorLight3
public static Color SystemAccentColorLight3 { get; }
Gets the lightest tint on the generated accent ramp.
SystemAccentColorPrimary
public static Color SystemAccentColorPrimary { get; }
Gets the primary accent color used for emphasis surfaces.
SystemAccentColorSecondary
public static Color SystemAccentColorSecondary { get; }
Gets the secondary accent color used for layered emphasis.
SystemAccentColorTertiary
public static Color SystemAccentColorTertiary { get; }
Gets the tertiary accent color used for subtle accent fills.
TitleBarActiveColor
public static Color TitleBarActiveColor { get; }
Gets the active titlebar color (from DWM AccentColor or default gray).
TitleBarInactiveColor
public static Color TitleBarInactiveColor { get; }
Gets the inactive titlebar color (from DWM AccentColorInactive or default gray).
WindowBorderColor
public static Color WindowBorderColor { get; }
Gets the window border color (titlebar active on Win11, blended on Win10).
Methods
ApplyCustomAccent
public static void ApplyCustomAccent(Color lightThemeAccent, Color darkThemeAccent)
Applies per-theme custom accent seeds and regenerates the accent ramp and theme resources. The intent is sticky: every later theme change regenerates the ramp from the seed matching the newly resolved theme, with no re-apply call needed.
Parameter lightThemeAccent: The ramp seed used on the light theme.
Parameter darkThemeAccent: The ramp seed used on dark and high-contrast themes.
ApplyCustomAccent
public static void ApplyCustomAccent(Color color)
Applies a custom base accent color and regenerates the accent ramp and theme resources.
Parameter color: The accent color to use as the ramp base.
ApplySystemAccent
public static void ApplySystemAccent()
Sets the accent intent to the live Windows accent palette and re-applies the current theme.
Events
AccentColorChanged
public static event EventHandler<EventArgs>? AccentColorChanged
Occurs after the theme engine publishes application resources, whether the publish follows a theme apply or an accent apply. A redundant apply raises no event.