# Accent Colors Accent colors provide visual emphasis and brand identity in WPF UI applications. The library manages accent color resources that automatically adapt to light and dark themes. > [!TIP] > Use `SystemThemeWatcher.Watch(this)` in your main window constructor to automatically sync accent colors with Windows personalization settings. ## Apply System Accent Use the system's personalization accent color: ```csharp using Wpf.Ui.Appearance; ApplicationAccentColorManager.ApplySystemAccent(); ``` ## Apply Theme with Accent Apply theme and accent together: ```csharp using Wpf.Ui.Appearance; using Wpf.Ui.Controls; ApplicationThemeManager.Apply( ApplicationTheme.Dark, WindowBackdropType.Mica, updateAccent: true // Automatically applies system accent ); ``` Available backdrop types: `None`, `Auto`, `Mica`, `Acrylic`, `Tabbed`. > [!IMPORTANT] > Always use `DynamicResource` (not `StaticResource`) for accent color bindings to receive runtime updates when accent changes. ## Apply Custom Accent Set a custom accent color: ```csharp ApplicationAccentColorManager.Apply( Color.FromArgb(0xFF, 0xEE, 0x00, 0xBB), ApplicationTheme.Dark ); ``` Retrieve the Windows colorization color programmatically: ```csharp Color colorizationColor = ApplicationAccentColorManager.GetColorizationColor(); ApplicationAccentColorManager.Apply(colorizationColor, ApplicationTheme.Dark); ``` ## Accent Color Resources WPF UI provides these accent color resources: ### System Accent Colors Base accent colors that update when you call `ApplicationAccentColorManager.Apply()`: - `SystemAccentColor` - Primary system accent - `SystemAccentColorPrimary` - Lighter/darker variant for light/dark themes - `SystemAccentColorSecondary` - More prominent variant (most commonly used) - `SystemAccentColorTertiary` - Strongest variant ```xml ``` > [!TIP] > `SystemAccentColorSecondary` is the most commonly used variant for interactive elements and provides optimal contrast in both light and dark themes. ### Accent Text Colors For text and interactive elements like links: - `AccentTextFillColorPrimaryBrush` - Primary accent text (rest/hover state) - `AccentTextFillColorSecondaryBrush` - Secondary accent text - `AccentTextFillColorTertiaryBrush` - Tertiary accent text (pressed state) - `AccentTextFillColorDisabledBrush` - Disabled accent text ```xml ``` ### Accent Fill Colors For button backgrounds and filled surfaces: - `AccentFillColorDefaultBrush` - Default accent fill - `AccentFillColorSecondaryBrush` - Secondary fill (90% opacity) - `AccentFillColorTertiaryBrush` - Tertiary fill (80% opacity) - `AccentFillColorDisabledBrush` - Disabled state fill ```xml