# ThemeManager

## Overview

Application-wide theme coordinator. Changing `CurrentTheme` raises `ThemeChanged` so controls can refresh via `ApplyTheme()`.

**Namespace:** `FTRThemes.Themes`  
**Type:** Static class  
**Related:** `FTRControls.Theming.FTRThemeColors`, `IThemeableControl`, `RichTextBoxIconSet`

## ThemeMode enum

| Value | Description |
|-------|-------------|
| `Light` | Default light chrome |
| `Dark` | Dark surfaces, light text |
| `Color` | Soft blue-tinted palette |
| `Duotone` | Warm duotone palette |

## Properties & events

| Member | Description |
|--------|-------------|
| `CurrentTheme` | Active mode; setter raises `ThemeChanged` |
| `ThemeChanged` | `EventHandler` — theme switched |

## Methods

| Method | Description |
|--------|-------------|
| `GetCurrentIconSet()` | Returns `RichTextBoxIconSet` for toolbar icons |

## RichTextBoxIconSet

Themed `Image` properties for toolbar: Copy, Paste, Cut, Bold, Italic, lists, Save, Open, Print, alignment, insert image/link, RTL/LTR, and more.

## FTRThemeColors (companion)

**Namespace:** `FTRControls.Theming`

Static palette resolved from `CurrentTheme`:

| Group | Examples |
|-------|----------|
| General | `ControlBackColor`, `PanelBackColor`, `TextPrimary`, `BorderColor` |
| Buttons | `ButtonNormal`, `ButtonHover`, `ButtonPressed` |
| Dashboard | `DarkDashboardBackColor`, `DarkSidebarBackColor`, … |
| Sidebar (FTRSidebar) | `DarkSidebarBack`, `DarkSidebarSelected`, … |
| Controls | `*DropDown*`, `*MessageBox*`, `*Numeric*`, `*Progress*`, `*Ribbon*`, `*Toast*`, `*Accordion*`, `*Calendar*` |

## Examples

```csharp
using FTRThemes.Themes;
using FTRControls.Theming;

// At startup
ThemeManager.CurrentTheme = ThemeManager.ThemeMode.Dark;

// Subscribe
ThemeManager.ThemeChanged += (_, _) =>
{
    myPanel.BackColor = FTRThemeColors.PanelBackColor;
    myControl.ApplyTheme();
};

// Rich text toolbar icons
var icons = ThemeManager.GetCurrentIconSet();
```

## Notes

- Most `FTRBaseControl` / `FTRBaseUserControl` derivatives subscribe automatically.
- `FTRSidebar` uses `DarkSidebarBack`; `FTRDashboard` uses `DarkSidebarBackColor` — different tokens.

## See also

- [FTRBaseControl.md](FTRBaseControl.md)
- [FTRControls.md](FTRControls.md)
